aewl

changeset 276:9a0a351dd910

pplied Sanders appendtag patch
author Anselm R.Garbe <arg@10ksloc.org>
date Mon, 14 Aug 2006 15:31:58 +0200
parents 425cd4490c1e
children 1e7fa455e3b4
files event.c tag.c
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/event.c	Mon Aug 14 15:11:02 2006 +0200
     1.2 +++ b/event.c	Mon Aug 14 15:31:58 2006 +0200
     1.3 @@ -4,6 +4,7 @@
     1.4   */
     1.5  #include "dwm.h"
     1.6  #include <stdlib.h>
     1.7 +#include <unistd.h>
     1.8  #include <X11/keysym.h>
     1.9  #include <X11/Xatom.h>
    1.10  
    1.11 @@ -360,6 +361,11 @@
    1.12  	unsigned int i;
    1.13  	KeyCode code;
    1.14  
    1.15 +	while(XGrabKeyboard(dpy, root, True, GrabModeAsync,
    1.16 +			 GrabModeAsync, CurrentTime) != GrabSuccess)
    1.17 +		usleep(1000);
    1.18 +	XUngrabKeyboard(dpy, CurrentTime);
    1.19 +
    1.20  	for(i = 0; i < len; i++) {
    1.21  		code = XKeysymToKeycode(dpy, key[i].keysym);
    1.22  		XGrabKey(dpy, code, key[i].mod, root, True,
     2.1 --- a/tag.c	Mon Aug 14 15:11:02 2006 +0200
     2.2 +++ b/tag.c	Mon Aug 14 15:31:58 2006 +0200
     2.3 @@ -37,11 +37,15 @@
     2.4  void
     2.5  appendtag(Arg *arg)
     2.6  {
     2.7 -	if(!sel)
     2.8 +	Client *c = sel;
     2.9 +
    2.10 +	if(!c)
    2.11  		return;
    2.12  
    2.13 -	sel->tags[arg->i] = True;
    2.14 +	c->tags[arg->i] = True;
    2.15  	arrange(NULL);
    2.16 +	focus(c);
    2.17 +	restack();
    2.18  }
    2.19  
    2.20  void