r13920 jmb - in /trunk/libnsfb: Makefile src/surface/x.c

netsurf at semichrome.net netsurf at semichrome.net
Sat May 12 19:00:49 BST 2012


Author: jmb
Date: Sat May 12 13:00:49 2012
New Revision: 13920

URL: http://source.netsurf-browser.org?rev=13920&view=rev
Log:
Speculative support for xcb-util 0.3.8 and xcbproto 1.6

Modified:
    trunk/libnsfb/Makefile
    trunk/libnsfb/src/surface/x.c

Modified: trunk/libnsfb/Makefile
URL: http://source.netsurf-browser.org/trunk/libnsfb/Makefile?rev=13920&r1=13919&r2=13920&view=diff
==============================================================================
--- trunk/libnsfb/Makefile (original)
+++ trunk/libnsfb/Makefile Sat May 12 13:00:49 2012
@@ -32,10 +32,30 @@
 endif 
 
 ifeq ($(NSFB_XCB_AVAILABLE),yes)
-  $(eval $(call pkg_config_package_min_version,NSFB_XCB_NEW_API,xcb,0.23))
+  # Size hint allocators were removed in xcb-icccm 0.3.0
+  $(eval $(call pkg_config_package_min_version,NSFB_XCB_ICCCM_SIZE_HINTS,xcb-icccm,0.3.0))
+  ifeq ($(NSFB_XCB_ICCCM_SIZE_HINTS),yes)
+    CFLAGS := $(CFLAGS) -DNSFB_NEED_HINTS_ALLOC
+  endif
 
-  ifeq ($(NSFB_XCB_NEW_API),yes)
-    CFLAGS := $(CFLAGS) -DNEED_HINTS_ALLOC
+  # xcb-icccm 0.3.8 introduced an additional "icccm_" in function names
+  $(eval $(call pkg_config_package_min_version,NSFB_XCB_ICCCM_API_PREFIX,xcb-icccm,0.3.8))
+  ifeq ($(NSFB_XCB_ICCCM_API_PREFIX),yes)
+    CFLAGS := $(CFLAGS) -DNSFB_NEED_ICCCM_API_PREFIX
+  endif
+
+  # xcbproto 1.6 incorporated atoms previously found in xcb_atom
+  # However, libxcb <1.3 did not report xcbproto versions. Assume xcbproto 1.5 in this case.
+  $(eval $(call pkg_config_package_min_version,NSFB_HAVE_MODERN_XCB,xcb,1.3))
+  ifeq ($(NSFB_HAVE_MODERN_XCB),yes)
+    $(eval $(call pkg_config_get_variable,NSFB_XCBPROTO_VERSION,xcb,xcbproto_version))
+    NSFB_XCBPROTO_MAJOR_VERSION := $(word 1,$(subst ., ,$(NSFB_XCBPROTO_VERSION)))
+    NSFB_XCBPROTO_MINOR_VERSION := $(word 2,$(subst ., ,$(NSFB_XCBPROTO_VERSION)))
+    CFLAGS := $(CFLAGS) -DNSFB_XCBPROTO_MAJOR_VERSION=$(NSFB_XCBPROTO_MAJOR_VERSION)
+    CFLAGS := $(CFLAGS) -DNSFB_XCBPROTO_MINOR_VERSION=$(NSFB_XCBPROTO_MINOR_VERSION)
+  else
+    CFLAGS := $(CFLAGS) -DNSFB_XCBPROTO_MAJOR_VERSION=1
+    CFLAGS := $(CFLAGS) -DNSFB_XCBPROTO_MINOR_VERSION=5
   endif
 
   $(eval $(call pkg_config_package_add_flags,$(NSFB_XCB_PKG_NAMES),CFLAGS))

Modified: trunk/libnsfb/src/surface/x.c
URL: http://source.netsurf-browser.org/trunk/libnsfb/src/surface/x.c?rev=13920&r1=13919&r2=13920&view=diff
==============================================================================
--- trunk/libnsfb/src/surface/x.c (original)
+++ trunk/libnsfb/src/surface/x.c Sat May 12 13:00:49 2012
@@ -33,7 +33,7 @@
 #include "plot.h"
 #include "cursor.h"
 
-#if defined(NEED_HINTS_ALLOC)
+#if defined(NSFB_NEED_HINTS_ALLOC)
 static xcb_size_hints_t *
 xcb_alloc_size_hints(void)
 {
@@ -45,6 +45,17 @@
 {
     free(hints);
 }
+#endif
+
+#if defined(NSFB_NEED_ICCCM_API_PREFIX)
+#define xcb_size_hints_set_max_size xcb_icccm_size_hints_set_max_size
+#define xcb_size_hints_set_min_size xcb_icccm_size_hints_set_min_size
+#define xcb_set_wm_size_hints       xcb_icccm_set_wm_size_hints
+#endif
+
+#if (NSFB_XCBPROTO_MAJOR_VERSION > 1) || \
+    (NSFB_XCBPROTO_MAJOR_VERSION == 1 && NSFB_XCBPROTO_MINOR_VERSION >= 6)
+#define WM_NORMAL_HINTS XCB_ATOM_WM_NORMAL_HINTS
 #endif
 
 #define X_BUTTON_LEFT 1




More information about the netsurf-commits mailing list