Some versions of X, have the Shape extension, but apparently not "ShapeInput" (Fixes bug )

the sawfish window manager has ifdefs for this sort of situation.
I followed suit, and #ifdef'd it, and it now works for me.
patch attached.

Slight changes to the patch from danakj@orodu.net for readability
This commit is contained in:
Philip Brown 2010-10-16 16:13:36 -04:00 committed by Dana Jansens
parent 7c33f45e09
commit 9c356d370a
2 changed files with 11 additions and 2 deletions

View file

@ -1695,10 +1695,12 @@ static void event_handle_client(ObClient *client, XEvent *e)
client->shaped = ((XShapeEvent*)e)->shaped; client->shaped = ((XShapeEvent*)e)->shaped;
kind = ShapeBounding; kind = ShapeBounding;
break; break;
#ifdef ShapeInput
case ShapeInput: case ShapeInput:
client->shaped_input = ((XShapeEvent*)e)->shaped; client->shaped_input = ((XShapeEvent*)e)->shaped;
kind = ShapeInput; kind = ShapeInput;
break; break;
#endif
default: default:
g_assert_not_reached(); g_assert_not_reached();
} }

View file

@ -276,9 +276,14 @@ void frame_adjust_shape_kind(ObFrame *self, int kind)
{ {
gint num; gint num;
XRectangle xrect[2]; XRectangle xrect[2];
gboolean shaped;
if (!((kind == ShapeBounding && self->client->shaped) || shaped = (kind == ShapeBounding && self->client->shaped);
(kind == ShapeInput && self->client->shaped_input))) { #ifdef ShapeInput
shaped |= (kind == ShapeInput && self->client->shaped_input);
#endif
if (!shaped) {
/* clear the shape on the frame window */ /* clear the shape on the frame window */
XShapeCombineMask(obt_display, self->window, kind, XShapeCombineMask(obt_display, self->window, kind,
self->size.left, self->size.left,
@ -323,8 +328,10 @@ void frame_adjust_shape(ObFrame *self)
{ {
#ifdef SHAPE #ifdef SHAPE
frame_adjust_shape_kind(self, ShapeBounding); frame_adjust_shape_kind(self, ShapeBounding);
#ifdef ShapeInput
frame_adjust_shape_kind(self, ShapeInput); frame_adjust_shape_kind(self, ShapeInput);
#endif #endif
#endif
} }
void frame_adjust_area(ObFrame *self, gboolean moved, void frame_adjust_area(ObFrame *self, gboolean moved,