From d691aa1d13c2b0f2e064341fc299ad27d8215750 Mon Sep 17 00:00:00 2001 From: David Hill Date: Tue, 17 Jul 2012 14:52:32 -0400 Subject: [PATCH] bring back the Display variable. Will be needed for the font code. --- Makefile | 2 +- spectrwm.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d454252..1d5b133 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ CFLAGS+=-std=gnu89 -Wall -Wno-uninitialized -g # Uncomment define below to disallow user settable clock format string #CFLAGS+=-DSWM_DENY_CLOCK_FORMAT CPPFLAGS+= -I${X11BASE}/include -LDADD+=-lutil -L${X11BASE}/lib -lX11 -lxcb -lxcb-aux -lxcb-icccm -lxcb-keysyms -lxcb-randr -lxcb-xtest +LDADD+=-lutil -L${X11BASE}/lib -lX11 -lX11-xcb -lxcb-aux -lxcb-icccm -lxcb-keysyms -lxcb-randr -lxcb-xtest BUILDVERSION != sh "${.CURDIR}/buildver.sh" .if !${BUILDVERSION} == "" CPPFLAGS+= -DSPECTRWM_BUILDSTR=\"$(BUILDVERSION)\" 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"); -- 2.39.2