From: Dana Jansens Date: Sun, 20 Jan 2008 07:17:41 +0000 (-0500) Subject: make obt check for composite X-Git-Tag: compgl~24 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=726443e940071659d7caa20b44c904c45c994388;p=dana%2Fopenbox.git make obt check for composite --- diff --git a/Makefile.am b/Makefile.am index 7eaa1942..a27eba24 100644 --- a/Makefile.am +++ b/Makefile.am @@ -100,6 +100,9 @@ obt_libobt_la_CPPFLAGS = \ $(XRANDR_CFLAGS) \ $(XSHAPE_CFLAGS) \ $(XSYNC_CFLAGS) \ + $(XRENDER_CFLAGS) \ + $(XDAMAGE_CFLAGS) \ + $(XCOMPOSITE_CFLAGS) \ $(GLIB_CFLAGS) \ $(XML_CFLAGS) \ -DG_LOG_DOMAIN=\"Obt\" \ @@ -114,6 +117,9 @@ obt_libobt_la_LIBADD = \ $(XRANDR_LIBS) \ $(XSHAPE_LIBS) \ $(XSYNC_LIBS) \ + $(XRENDER_LIBS) \ + $(XDAMAGE_LIBS) \ + $(XCOMPOSITE_LIBS) \ $(GLIB_LIBS) \ $(XML_LIBS) obt_libobt_la_SOURCES = \ diff --git a/configure.ac b/configure.ac index 463e7fb3..b26065f2 100644 --- a/configure.ac +++ b/configure.ac @@ -160,6 +160,51 @@ else xcursor_found=no fi +AC_ARG_ENABLE(xcomposite, + AC_HELP_STRING( + [--disable-xcomposite], + [disable use of the X Composite library. [[default=enabled]]] + ), + [enable_xcomposite=$enableval], + [enable_xcomposite=yes] +) + +if test "$enable_xcomposite" = yes; then +PKG_CHECK_MODULES(XRENDER, [xrender], + [ + AC_DEFINE(USE_XRENDER, [1], [Use X Render library]) + AC_SUBST(XRENDER_CFLAGS) + AC_SUBST(XRENDER_LIBS) + PKG_CHECK_MODULES(XDAMAGE, [xdamage], + [ + AC_DEFINE(USE_XDAMAGE, [1], [Use X Damage library]) + AC_SUBST(XDAMAGE_CFLAGS) + AC_SUBST(XDAMAGE_LIBS) + PKG_CHECK_MODULES(XCOMPOSITE, [xcomposite], + [ + AC_DEFINE(USE_XCOMPOSITE, [1], [Use X Composite library]) + AC_SUBST(XCOMPOSITE_CFLAGS) + AC_SUBST(XCOMPOSITE_LIBS) + xcomposite_found=yes + ], + [ + xcomposite_found=no + ] + ) + ], + [ + xcomposite_found=no + ] + ) + ], + [ + xcomposite_found=no + ] +) +else + xcomposite_found=no +fi + dnl Check for session management X11_SM @@ -195,6 +240,7 @@ AC_MSG_RESULT AC_MSG_RESULT([Compiling with these options: Startup Notification... $sn_found X Cursor Library... $xcursor_found + X Composite Library... $xcomposite_found Session Management... $SM ]) AC_MSG_RESULT([configure complete, now type "make"]) diff --git a/obt/display.c b/obt/display.c index d72f8ad6..97a2992b 100644 --- a/obt/display.c +++ b/obt/display.c @@ -1,7 +1,7 @@ /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- obt/display.c for the Openbox window manager - Copyright (c) 2007 Dana Jansens + Copyright (c) 2007-2008 Dana Jansens This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,6 +45,8 @@ gboolean obt_display_extension_randr = FALSE; gint obt_display_extension_randr_basep; gboolean obt_display_extension_sync = FALSE; gint obt_display_extension_sync_basep; +gboolean obt_display_extension_composite = FALSE; +gint obt_display_extension_composite_basep; static gint xerror_handler(Display *d, XErrorEvent *e); @@ -109,6 +111,22 @@ gboolean obt_display_open(const char *display_name) "incompatible version"); #endif +#ifdef USE_XCOMPOSITE + if (XCompositeQueryExtension(d, &obt_display_extension_composite_basep, + &junk)) + { + gint major = 0, minor = 2; + XCompositeQueryVersion(d, &major, &minor); + /* Version 0.2 is the first version to have the + XCompositeNameWindowPixmap() request. */ + if (major > 0 || minor >= 2) + obt_display_extension_composite = TRUE; + } + if (!obt_display_extension_composite) + g_message("X Composite extension is not present on the server or " + "is an incompatible version"); +#endif + obt_prop_startup(); obt_keyboard_reload(); } diff --git a/obt/display.h b/obt/display.h index 8c074b5b..5d995338 100644 --- a/obt/display.h +++ b/obt/display.h @@ -1,7 +1,7 @@ /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*- obt/display.h for the Openbox window manager - Copyright (c) 2007 Dana Jansens + Copyright (c) 2007-2008 Dana Jansens This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,6 +38,11 @@ #ifdef SYNC #include #endif +#ifdef USE_XCOMPOSITE +#include +#include +#include +#endif G_BEGIN_DECLS @@ -53,6 +58,8 @@ extern gboolean obt_display_extension_randr; extern gint obt_display_extension_randr_basep; extern gboolean obt_display_extension_sync; extern gint obt_display_extension_sync_basep; +extern gboolean obt_display_extension_composite; +extern gint obt_display_extension_composite_basep; extern Display* obt_display;