dmenu

dynamic menu
git clone git://git.suckless.org/dmenu
Log | Files | Refs | README | LICENSE

commit b1e217b29aab8936e9831961943676acd9cdcdd8
parent 86f0b5119eaa39943013d009967432ffd9d18365
Author: Adam Purkrt <adam@purkrt.cz>
Date:   Sat, 15 Mar 2025 19:53:56 +0100

XUngrabKeyboard() instead of XUngrabKey()

XUngrabKey(), which is currently used in cleanup(), is not the right
counterpart to XGrabKeyboard(), which is used in grabkeyboard(),
called from main().

XUngrabKeyboard() is the function to use, as grabbing the whole
keyboard is different to grabbing individual keys.

With the current code the keyboard gets ungrabbed, as far as I can tell,
only by the final XCloseDisplay() in cleanup(), as the XUngrabKey()
there effectively does nothing.

Diffstat:
Mdmenu.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dmenu.c b/dmenu.c @@ -100,7 +100,7 @@ cleanup(void) { size_t i; - XUngrabKey(dpy, AnyKey, AnyModifier, root); + XUngrabKeyboard(dpy, CurrentTime); for (i = 0; i < SchemeLast; i++) free(scheme[i]); for (i = 0; items && items[i].text; ++i)