commit e93ee95fe93a2e741abee183cad0b2fbabe00e5a
parent aa42a4ea27a184dc5d3f6256dc8efc5956557a7d
Author: lostd <lostd@2f30.org>
Date: Thu, 6 Apr 2017 12:38:12 +0300
Close display before exiting plugin
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/key.c b/key.c
@@ -29,6 +29,7 @@ keyread(void *arg, char *buf, size_t len)
keycode = XKeysymToKeycode(dpy, key->sym);
if (keycode == NoSymbol) {
warnx("no key code for this symbol");
+ XCloseDisplay(dpy);
return -1;
}
map = XGetModifierMapping(dpy);
@@ -38,6 +39,7 @@ keyread(void *arg, char *buf, size_t len)
XFreeModifiermap(map);
XQueryPointer(dpy, DefaultRootWindow(dpy),
&w1, &w2, &i1, &i2, &i3, &i4, &modmask);
+ XCloseDisplay(dpy);
on = (keymask & modmask) != 0;
DPRINTF_D(on);
if (on)