]> code.delx.au - spectrwm/commitdiff
initial code to compile in xcb support.
authorDavid Hill <dhill@conformal.com>
Tue, 3 Jul 2012 19:51:50 +0000 (15:51 -0400)
committerReginald Kennedy <rk@rejii.com>
Fri, 20 Jul 2012 21:58:29 +0000 (05:58 +0800)
many more diffs coming.

Makefile
spectrwm.c

index e31cdb85a7e40e49b1a6be1cba468b370f68f596..f61d5c56f37df937d0fe481d225fa5963a45399e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@ CFLAGS+=-std=c89 -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 -lXrandr -lXtst
+LDADD+=-lutil -L${X11BASE}/lib -lX11-xcb -lXrandr -lXtst
 BUILDVERSION != sh "${.CURDIR}/buildver.sh"
 .if !${BUILDVERSION} == ""
 CPPFLAGS+= -DSPECTRWM_BUILDSTR=\"$(BUILDVERSION)\"
index 5b97af2f11104da3f14fa6d2668cdb6cb11d9774..225029bd13cd15d374b6b6009bef8a0efb45468e 100644 (file)
@@ -90,7 +90,7 @@
 #include <X11/keysym.h>
 #include <X11/XKBlib.h>
 #include <X11/Xatom.h>
-#include <X11/Xlib.h>
+#include <X11/Xlib-xcb.h>
 #include <X11/Xproto.h>
 #include <X11/Xutil.h>
 #include <X11/extensions/Xrandr.h>
@@ -221,6 +221,7 @@ int                 xrandr_support;
 int                    xrandr_eventbase;
 unsigned int           numlockmask = 0;
 Display                        *display;
+xcb_connection_t       *conn;
 
 int                    cycle_empty = 0;
 int                    cycle_visible = 0;
@@ -2159,6 +2160,7 @@ restart(struct swm_region *r, union arg *args)
        bar_extra_stop();
        bar_extra = 1;
        unmap_all();
+       xcb_disconnect(conn);
        XCloseDisplay(display);
        execvp(start_argv[0], start_argv);
        warn("execvp failed");
@@ -7418,6 +7420,9 @@ main(int argc, char *argv[])
        if (!(display = XOpenDisplay(0)))
                errx(1, "can not open display");
 
+       if (!(conn = XGetXCBConnection(display)))
+               errx(1, "can not get XCB connection");
+
        if (active_wm())
                errx(1, "other wm running");
 
@@ -7597,6 +7602,7 @@ done:
                        XFreeGC(display, screens[i].bar_gc);
 
        XFreeFontSet(display, bar_fs);
+       xcb_disconnect(conn);   
        XCloseDisplay(display);
 
        return (0);