sites

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

dwm-pwkl-6.2.diff (1597B)


      1 diff --color -up /tmp/dwm-6.2/dwm.c dwm-6.2/dwm.c
      2 --- /tmp/dwm-6.2/dwm.c	2019-02-02 14:55:28.000000000 +0200
      3 +++ dwm-6.2/dwm.c	2020-12-01 12:20:55.584639058 +0200
      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 @@ -97,6 +98,7 @@ struct Client {
     13  	Client *snext;
     14  	Monitor *mon;
     15  	Window win;
     16 +	unsigned char kbdgrp;
     17  };
     18  
     19  typedef struct {
     20 @@ -792,6 +794,7 @@ focus(Client *c)
     21  			selmon = c->mon;
     22  		if (c->isurgent)
     23  			seturgent(c, 0);
     24 +		XkbLockGroup(dpy, XkbUseCoreKbd, c->kbdgrp);
     25  		detachstack(c);
     26  		attachstack(c);
     27  		grabbuttons(c, 1);
     28 @@ -1020,6 +1023,7 @@ manage(Window w, XWindowAttributes *wa)
     29  	Client *c, *t = NULL;
     30  	Window trans = None;
     31  	XWindowChanges wc;
     32 +	XkbStateRec kbd_state;
     33  
     34  	c = ecalloc(1, sizeof(Client));
     35  	c->win = w;
     36 @@ -1071,6 +1075,8 @@ manage(Window w, XWindowAttributes *wa)
     37  	if (c->mon == selmon)
     38  		unfocus(selmon->sel, 0);
     39  	c->mon->sel = c;
     40 +	XkbGetState(dpy, XkbUseCoreKbd, &kbd_state);
     41 +	c->kbdgrp = kbd_state.group;
     42  	arrange(c->mon);
     43  	XMapWindow(dpy, c->win);
     44  	focus(NULL);
     45 @@ -1749,6 +1755,7 @@ toggleview(const Arg *arg)
     46  void
     47  unfocus(Client *c, int setfocus)
     48  {
     49 +	XkbStateRec kbd_state;
     50  	if (!c)
     51  		return;
     52  	grabbuttons(c, 0);
     53 @@ -1757,6 +1764,8 @@ unfocus(Client *c, int setfocus)
     54  		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
     55  		XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
     56  	}
     57 +	XkbGetState(dpy, XkbUseCoreKbd, &kbd_state);
     58 +	c->kbdgrp = kbd_state.group;
     59  }
     60  
     61  void