sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-pwkl-5.9.diff (1384B)


      1 diff -r 406003e3a01f dwm.c
      2 --- a/dwm.c	Mon Sep 27 07:53:44 2010 +0000
      3 +++ b/dwm.c	Wed Oct 13 21:16:04 2010 +0300
      4 @@ -36,6 +36,7 @@
      5  #include <X11/Xlib.h>
      6  #include <X11/Xproto.h>
      7  #include <X11/Xutil.h>
      8 +#include <X11/XKBlib.h>
      9  #ifdef XINERAMA
     10  #include <X11/extensions/Xinerama.h>
     11  #endif /* XINERAMA */
     12 @@ -93,6 +94,7 @@
     13  	Client *snext;
     14  	Monitor *mon;
     15  	Window win;
     16 +	unsigned char kbdgrp;
     17  };
     18  
     19  typedef struct {
     20 @@ -821,6 +823,7 @@
     21  			selmon = c->mon;
     22  		if(c->isurgent)
     23  			clearurgent(c);
     24 +		XkbLockGroup (dpy, XkbUseCoreKbd, c->kbdgrp);
     25  		detachstack(c);
     26  		attachstack(c);
     27  		grabbuttons(c, True);
     28 @@ -1092,6 +1095,7 @@
     29  	Client *c, *t = NULL;
     30  	Window trans = None;
     31  	XWindowChanges wc;
     32 +	XkbStateRec kbd_state;
     33  
     34  	if(!(c = malloc(sizeof(Client))))
     35  		die("fatal: could not malloc() %u bytes\n", sizeof(Client));
     36 @@ -1146,6 +1150,8 @@
     37  	XMapWindow(dpy, c->win);
     38  	setclientstate(c, NormalState);
     39  	arrange(c->mon);
     40 +	XkbGetState (dpy, XkbUseCoreKbd, &kbd_state);
     41 +	c->kbdgrp = kbd_state.group;
     42  }
     43  
     44  void
     45 @@ -1700,12 +1706,16 @@
     46  
     47  void
     48  unfocus(Client *c, Bool setfocus) {
     49 +	XkbStateRec kbd_state;
     50 +	
     51  	if(!c)
     52  		return;
     53  	grabbuttons(c, False);
     54  	XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]);
     55  	if(setfocus)
     56  		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
     57 +	XkbGetState (dpy, XkbUseCoreKbd, &kbd_state);
     58 +	c->kbdgrp = kbd_state.group;
     59  }
     60  
     61  void