pplied Sanders appendtag patch fe3dfbbe
Anselm R.Garbe · 2006-08-14 15:31 2 file(s) · +12 −2
event.c +6 −0
4 4
 */
5 5
#include "dwm.h"
6 6
#include <stdlib.h>
7 +
#include <unistd.h>
7 8
#include <X11/keysym.h>
8 9
#include <X11/Xatom.h>
9 10
359 360
	static unsigned int len = sizeof(key) / sizeof(key[0]);
360 361
	unsigned int i;
361 362
	KeyCode code;
363 +
364 +
	while(XGrabKeyboard(dpy, root, True, GrabModeAsync,
365 +
			 GrabModeAsync, CurrentTime) != GrabSuccess)
366 +
		usleep(1000);
367 +
	XUngrabKeyboard(dpy, CurrentTime);
362 368
363 369
	for(i = 0; i < len; i++) {
364 370
		code = XKeysymToKeycode(dpy, key[i].keysym);
tag.c +6 −2
37 37
void
38 38
appendtag(Arg *arg)
39 39
{
40 -
	if(!sel)
40 +
	Client *c = sel;
41 +
42 +
	if(!c)
41 43
		return;
42 44
43 -
	sel->tags[arg->i] = True;
45 +
	c->tags[arg->i] = True;
44 46
	arrange(NULL);
47 +
	focus(c);
48 +
	restack();
45 49
}
46 50
47 51
void