=== modified file 'openbox/extensions.c' --- openbox/extensions.c 2008-10-16 06:15:37 +0000 +++ openbox/extensions.c 2008-10-18 21:21:53 +0000 @@ -27,6 +27,7 @@ gint extensions_xkb_event_basep; gboolean extensions_shape = FALSE; gint extensions_shape_event_basep; +gboolean extensions_shape_inputmasks = FALSE; gboolean extensions_xinerama = FALSE; gint extensions_xinerama_event_basep; gboolean extensions_randr = FALSE; @@ -51,8 +52,20 @@ extensions_shape = XShapeQueryExtension(ob_display, &extensions_shape_event_basep, &junk); +#ifdef ShapeInput + if (extensions_shape) { + gint v_major, v_minor; + if (XShapeQueryVersion(ob_display, &v_major, &v_minor)) { + if ((v_major == 1 && v_minor >= 1) || v_major > 1) + extensions_shape_inputmasks = TRUE; + } + } +#endif + if (!extensions_shape) ob_debug("X Shape extension is not present on the server\n"); + else if(!extensions_shape_inputmasks) + ob_debug("X Shape extension doesn't support input masks\n"); #endif #ifdef XINERAMA === modified file 'openbox/extensions.h' --- openbox/extensions.h 2008-10-16 06:15:37 +0000 +++ openbox/extensions.h 2008-10-18 21:24:32 +0000 @@ -51,6 +51,8 @@ extern gboolean extensions_shape; /*! Base for events for the Shape extension */ extern gint extensions_shape_event_basep; +/*! Does the X Shape extension support input masks? */ +extern gboolean extensions_shape_inputmasks; /*! Does the display have the Xinerama extension? */ extern gboolean extensions_xinerama; === modified file 'openbox/frame.c' --- openbox/frame.c 2008-10-16 06:15:37 +0000 +++ openbox/frame.c 2008-10-18 21:28:14 +0000 @@ -276,8 +276,8 @@ if (!self->client->shaped) { /* clear the shape on the frame window */ XShapeCombineMask(ob_display, self->window, ShapeBounding, - self->size.left, - self->size.top, + 0, + 0, None, ShapeSet); } else { /* make the frame's shape match the clients */ @@ -310,6 +310,21 @@ XShapeCombineRectangles(ob_display, self->window, ShapeBounding, 0, 0, xrect, num, ShapeUnion, Unsorted); + +#ifdef ShapeInput + if (extensions_shape_inputmasks) { + /* make the frame's shape match the clients */ + XShapeCombineShape(ob_display, self->window, ShapeInput, + self->size.left, + self->size.top, + self->client->window, + ShapeInput, ShapeSet); + + XShapeCombineRectangles(ob_display, self->window, + ShapeInput, 0, 0, xrect, num, + ShapeUnion, Unsorted); + } +#endif } #endif }