diff --git a/ChangeLog b/ChangeLog index a9f324ccf2..babf98b97d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-02-26 Sven Neumann + + * 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 * app/core/gimp-transform-region.c: added more const qualifiers. diff --git a/configure.in b/configure.in index f7f544bb44..270dd51b12 100644 --- a/configure.in +++ b/configure.in @@ -905,13 +905,14 @@ if test "$gdk_target" = x11; then dnl doc-shooter is X11 specific DOC_SHOOTER=doc-shooter + gimp_save_CFLAGS="$CFLAGS" + gimp_save_LDFLAGS="$LDFLAGS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LDFLAGS="$LDFLAGS $X_LIBS" + dnl Test for Xmu enable_gimp_remote=yes 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_HEADERS(X11/Xmu/WinUtil.h, 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", [enable_gimp_remote="no (XMU header file not found)"],[#include ])], [enable_gimp_remote="no (XMU library not found)"], -lXt -lX11) - CFLAGS="$gimp_save_CFLAGS" - LDFLAGS="$gimp_save_LDFLAGS" LIBSCREENSHOT="$LIBXMU" fi + + dnl Check for shaped window extension + AC_CHECK_LIB(Xext, XShapeGetRectangles, + [AC_CHECK_HEADERS(X11/extensions/shape.h, + LIBSCREENSHOT="$LIBSCREENSHOT -lXext",,[#include ])],, + -lX11 -lXext) + + CFLAGS="$gimp_save_CFLAGS" + LDFLAGS="$gimp_save_LDFLAGS" else enable_gimp_remote="no (building for $gdk_target)" fi diff --git a/plug-ins/common/screenshot.c b/plug-ins/common/screenshot.c index f23e4749c7..a973e9a90c 100644 --- a/plug-ins/common/screenshot.c +++ b/plug-ins/common/screenshot.c @@ -36,7 +36,10 @@ #if defined(GDK_WINDOWING_X11) #include + +#ifdef HAVE_X11_EXTENSIONS_SHAPE_H #include +#endif /* HAVE_X11_EXTENSIONS_SHAPE_H */ #ifdef HAVE_X11_XMU_WINUTIL_H #include @@ -636,12 +639,13 @@ static GdkRegion * window_get_shape (GdkScreen *screen, GdkNativeWindow window) { - GdkRegion *shape = NULL; -#if defined(GDK_WINDOWING_X11) - Display *x_dpy = GDK_SCREEN_XDISPLAY (screen); - XRectangle *rects; - gint rect_count; - gint rect_order; + GdkRegion *shape = NULL; + +#if defined(GDK_WINDOWING_X11) && defined(HAVE_X11_EXTENSIONS_SHAPE_H) + Display *x_dpy = GDK_SCREEN_XDISPLAY (screen); + XRectangle *rects; + gint rect_count; + gint rect_order; rects = XShapeGetRectangles (x_dpy, window, ShapeBounding, &rect_count, &rect_order);