sites

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

tabbed-ungrabkey-0.8.diff (875B)


      1 Author: Chris Noxz <chris@noxz.tech>
      2 
      3 diff -upN tabbed-0.8-a/tabbed.c tabbed-0.8-b/tabbed.c
      4 --- tabbed-0.8-a/tabbed.c	2024-03-19 12:23:17.000000000 +0100
      5 +++ tabbed-0.8-b/tabbed.c	2024-06-11 20:07:21.814961956 +0200
      6 @@ -1132,6 +1132,11 @@ toggle(const Arg *arg)
      7  void
      8  unmanage(int c)
      9  {
     10 +	int i, j;
     11 +	unsigned int modifiers[] = { 0, LockMask, numlockmask,
     12 +	                             numlockmask | LockMask };
     13 +	KeyCode code;
     14 +
     15  	if (c < 0 || c >= nclients) {
     16  		drawbar();
     17  		XSync(dpy, False);
     18 @@ -1141,6 +1146,15 @@ unmanage(int c)
     19  	if (!nclients)
     20  		return;
     21  
     22 +	/* ungrab keys */
     23 +	for (i = 0; i < LENGTH(keys); i++) {
     24 +		if ((code = XKeysymToKeycode(dpy, keys[i].keysym))) {
     25 +			for (j = 0; j < LENGTH(modifiers); j++) {
     26 +				XUngrabKey(dpy, code, keys[i].mod | modifiers[j], clients[c]->win);
     27 +			}
     28 +		}
     29 +	}
     30 +
     31  	if (c == 0) {
     32  		/* First client. */
     33  		nclients--;