configure.in added checks for X11 Shape Extension and build the shaped

2007-02-26  Sven Neumann  <sven@gimp.org>

	* configure.in
	* plug-ins/common/screenshot.c: added checks for X11 Shape
	Extension and build the shaped window feature conditionally.

svn path=/trunk/; revision=21993
This commit is contained in:
Sven Neumann 2007-02-26 10:20:22 +00:00 committed by Sven Neumann
parent cc6a517f5b
commit d197451496
3 changed files with 30 additions and 12 deletions

View File

@ -1,3 +1,9 @@
2007-02-26 Sven Neumann <sven@gimp.org>
* configure.in:
* plug-ins/common/screenshot.c: added checks for X11 Shape
Extension and build the shaped window feature conditionally.
2007-02-26 Sven Neumann <sven@gimp.org> 2007-02-26 Sven Neumann <sven@gimp.org>
* app/core/gimp-transform-region.c: added more const qualifiers. * app/core/gimp-transform-region.c: added more const qualifiers.

View File

@ -905,13 +905,14 @@ if test "$gdk_target" = x11; then
dnl doc-shooter is X11 specific dnl doc-shooter is X11 specific
DOC_SHOOTER=doc-shooter DOC_SHOOTER=doc-shooter
gimp_save_CFLAGS="$CFLAGS"
gimp_save_LDFLAGS="$LDFLAGS"
CFLAGS="$CFLAGS $GTK_CFLAGS"
LDFLAGS="$LDFLAGS $X_LIBS"
dnl Test for Xmu dnl Test for Xmu
enable_gimp_remote=yes enable_gimp_remote=yes
if test -z "$LIBXMU"; then if test -z "$LIBXMU"; then
gimp_save_CFLAGS="$CFLAGS"
gimp_save_LDFLAGS="$LDFLAGS"
CFLAGS="$CFLAGS $GTK_CFLAGS"
LDFLAGS="$LDFLAGS $X_LIBS"
AC_CHECK_LIB(Xmu, XmuClientWindow, AC_CHECK_LIB(Xmu, XmuClientWindow,
[AC_CHECK_HEADERS(X11/Xmu/WinUtil.h, [AC_CHECK_HEADERS(X11/Xmu/WinUtil.h,
GIMP_REMOTE='gimp-remote-gimp_app_version$(EXEEXT)'; GIMP_REMOTE='gimp-remote-gimp_app_version$(EXEEXT)';
@ -920,10 +921,17 @@ if test "$gdk_target" = x11; then
LIBXMU="$X_LIBS $X_PRE_LIBS -lX11 -lXmu -lXt", LIBXMU="$X_LIBS $X_PRE_LIBS -lX11 -lXmu -lXt",
[enable_gimp_remote="no (XMU header file not found)"],[#include <gdk/gdkx.h>])], [enable_gimp_remote="no (XMU header file not found)"],[#include <gdk/gdkx.h>])],
[enable_gimp_remote="no (XMU library not found)"], -lXt -lX11) [enable_gimp_remote="no (XMU library not found)"], -lXt -lX11)
CFLAGS="$gimp_save_CFLAGS"
LDFLAGS="$gimp_save_LDFLAGS"
LIBSCREENSHOT="$LIBXMU" LIBSCREENSHOT="$LIBXMU"
fi fi
dnl Check for shaped window extension
AC_CHECK_LIB(Xext, XShapeGetRectangles,
[AC_CHECK_HEADERS(X11/extensions/shape.h,
LIBSCREENSHOT="$LIBSCREENSHOT -lXext",,[#include <gdk/gdkx.h>])],,
-lX11 -lXext)
CFLAGS="$gimp_save_CFLAGS"
LDFLAGS="$gimp_save_LDFLAGS"
else else
enable_gimp_remote="no (building for $gdk_target)" enable_gimp_remote="no (building for $gdk_target)"
fi fi

View File

@ -36,7 +36,10 @@
#if defined(GDK_WINDOWING_X11) #if defined(GDK_WINDOWING_X11)
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
#ifdef HAVE_X11_EXTENSIONS_SHAPE_H
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#endif /* HAVE_X11_EXTENSIONS_SHAPE_H */
#ifdef HAVE_X11_XMU_WINUTIL_H #ifdef HAVE_X11_XMU_WINUTIL_H
#include <X11/Xmu/WinUtil.h> #include <X11/Xmu/WinUtil.h>
@ -636,12 +639,13 @@ static GdkRegion *
window_get_shape (GdkScreen *screen, window_get_shape (GdkScreen *screen,
GdkNativeWindow window) GdkNativeWindow window)
{ {
GdkRegion *shape = NULL; GdkRegion *shape = NULL;
#if defined(GDK_WINDOWING_X11)
Display *x_dpy = GDK_SCREEN_XDISPLAY (screen); #if defined(GDK_WINDOWING_X11) && defined(HAVE_X11_EXTENSIONS_SHAPE_H)
XRectangle *rects; Display *x_dpy = GDK_SCREEN_XDISPLAY (screen);
gint rect_count; XRectangle *rects;
gint rect_order; gint rect_count;
gint rect_order;
rects = XShapeGetRectangles (x_dpy, window, ShapeBounding, rects = XShapeGetRectangles (x_dpy, window, ShapeBounding,
&rect_count, &rect_order); &rect_count, &rect_order);