diff options
Diffstat (limited to 'slstatus.c')
-rw-r--r-- | slstatus.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -380,9 +380,15 @@ kernel_release(void) static const char * keyboard_indicators(void) { + Display *dpy = XOpenDisplay(NULL); XKeyboardState state; + if (dpy == NULL) { + warnx("XOpenDisplay failed"); + return UNKNOWN_STR; + } XGetKeyboardControl(dpy, &state); + XCloseDisplay(dpy); switch (state.led_mask) { case 1: |