X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=dee3300cd07756d8f87210bfafec0b179a0a94b5;hb=d691aa1d13c2b0f2e064341fc299ad27d8215750;hp=4699392923002d439183cd24cf811cab5956e9b7;hpb=b1b60af57d5187e8382fc3078b5157b5df9b00ab;p=spectrwm.git diff --git a/spectrwm.c b/spectrwm.c index 4699392..dee3300 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -89,7 +89,7 @@ #include #include #include -#include +#include #include #include #include @@ -260,6 +260,8 @@ int ss_enabled = 0; int xrandr_support; int xrandr_eventbase; unsigned int numlockmask = 0; + +Display *display; xcb_connection_t *conn; xcb_key_symbols_t *syms; @@ -7712,7 +7714,10 @@ main(int argc, char *argv[]) sact.sa_flags = SA_NOCLDSTOP; sigaction(SIGCHLD, &sact, NULL); - conn = xcb_connect(NULL, NULL); + if (!(display = XOpenDisplay(0))) + errx(1, "can not open display"); + + conn = XGetXCBConnection(display); if (xcb_connection_has_error(conn)) errx(1, "can not get XCB connection");