Author: olivier Date: 2007-04-02 19:31:29 +0000 (Mon, 02 Apr 2007) New Revision: 25370
Modified: xfwm4/branches/xfce_4_2/src/display.c xfwm4/branches/xfce_4_2/src/frame.c Log: Add support for shape input with XShape extension 1.1 (Bug #3092) Modified: xfwm4/branches/xfce_4_2/src/display.c =================================================================== --- xfwm4/branches/xfce_4_2/src/display.c 2007-04-02 19:19:01 UTC (rev 25369) +++ xfwm4/branches/xfce_4_2/src/display.c 2007-04-02 19:31:29 UTC (rev 25370) @@ -157,6 +157,7 @@ myDisplayInit (GdkDisplay *gdisplay) { DisplayInfo *display; + int major, minor; int dummy; display = g_new0 (DisplayInfo, 1); @@ -173,10 +174,19 @@ } /* Test XShape extension support */ - display->shape = - XShapeQueryExtension (display->dpy, &display->shape_event, &dummy); - if (!display->shape) + major = 0; + minor = 0; + display->shape = 0; + + if (XShapeQueryExtension (display->dpy, &display->shape_event, &dummy)) { + if (XShapeQueryVersion (display->dpy, &major, &minor)) + { + display->shape = major * 1000 + minor; + } + } + else + { g_warning ("The display does not support the XShape extension."); } Modified: xfwm4/branches/xfce_4_2/src/frame.c =================================================================== --- xfwm4/branches/xfce_4_2/src/frame.c 2007-04-02 19:19:01 UTC (rev 25369) +++ xfwm4/branches/xfce_4_2/src/frame.c 2007-04-02 19:31:29 UTC (rev 25370) @@ -37,6 +37,10 @@ #include "frame.h" #include "compositor.h" +#ifndef ShapeInput +#define ShapeInput 2; +#endif + int frameDecorationLeft (ScreenInfo *screen_info) { @@ -757,6 +761,13 @@ XShapeCombineRectangles (display_info->dpy, temp, ShapeBounding, 0, 0, &rect, 1, ShapeIntersect, 0); XShapeCombineShape (display_info->dpy, c->frame, ShapeBounding, 0, 0, temp, ShapeBounding, ShapeSet); + /* Set Input shape when using XShape extension 1.1 and later */ + if (display_info->shape >= 1001) + { + XShapeCombineShape (display_info->dpy, temp, ShapeInput, frameLeft (c), frameTop (c), c->window, ShapeBounding, ShapeSubtract); + XShapeCombineShape (display_info->dpy, temp, ShapeInput, frameLeft (c), frameTop (c), c->window, ShapeInput, ShapeUnion); + XShapeCombineShape (display_info->dpy, c->frame, ShapeInput, 0, 0, temp, ShapeInput, ShapeSet); + } XDestroyWindow (display_info->dpy, temp); } _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits