From: Michael Stapelberg Date: Fri, 12 Aug 2011 21:09:36 +0000 (+0200) Subject: Pass NULL to XkbOpenDisplay, it will read $DISPLAY itself X-Git-Tag: 4.0.2~43^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=72ef8a7c196871e0627a976317297d67e87daa47;p=i3%2Fi3 Pass NULL to XkbOpenDisplay, it will read $DISPLAY itself --- diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index 1afa8bd1..ba7d2346 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -506,11 +506,7 @@ char *init_xcb(char *fontname) { xkb_major = XkbMajorVersion; xkb_minor = XkbMinorVersion; - char *dispname = getenv("DISPLAY"); - if (dispname == NULL) { - dispname = ":0"; - } - xkb_dpy = XkbOpenDisplay(dispname, + xkb_dpy = XkbOpenDisplay(NULL, &xkb_event_base, &xkb_errbase, &xkb_major,