Introduction
Introduction Statistics Contact Development Disclaimer Help
tDon't keep state for X display - spoon - dwm status utility (2f30 fork)
git clone git://src.adamsgaard.dk/spoon
Log
Files
Refs
LICENSE
---
commit dc742d20742b5b09431e66db6f726c86fdc95e47
parent 26f4036b31ba4d4b96fb8f103fdc30a897438e46
Author: lostd <[email protected]>
Date: Thu, 6 Apr 2017 10:52:28 +0300
Don't keep state for X display
Diffstat:
M key.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/key.c b/key.c
t@@ -10,7 +10,7 @@
int
keyread(void *arg, char *buf, size_t len)
{
- static Display *dpy = NULL;
+ Display *dpy;
XModifierKeymap *map;
KeyCode keycode;
Window w1, w2;
t@@ -21,12 +21,10 @@ keyread(void *arg, char *buf, size_t len)
int on;
int i;
+ dpy = XOpenDisplay(NULL);
if (dpy == NULL) {
- dpy = XOpenDisplay(NULL);
- if (dpy == NULL) {
- warnx("cannot open display");
- return -1;
- }
+ warnx("cannot open display");
+ return -1;
}
keycode = XKeysymToKeycode(dpy, key->sym);
if (keycode == NoSymbol) {
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.