diff options
| author | Mikael Magnusson <mikachu@gmail.com> | 2009-01-29 22:45:47 +0100 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2009-01-29 22:45:47 +0100 |
| commit | 4145468a1984e1055a947ad957075ae51f70ca9c (patch) | |
| tree | 923b1d6ae11d4ba0c471779229d2f76642bf4774 /openbox | |
| parent | 90cecafa3de2f118e550622932d1d30266c71226 (diff) | |
| parent | d0829d4416d83fda4aa4ec8d5f0a7003b0a7f148 (diff) | |
Merge branch 'backport' into work
Conflicts:
openbox/event.c
openbox/frame.c
Diffstat (limited to 'openbox')
| -rw-r--r-- | openbox/client.h | 2 | ||||
| -rw-r--r-- | openbox/event.c | 21 | ||||
| -rw-r--r-- | openbox/frame.c | 21 | ||||
| -rw-r--r-- | openbox/frame.h | 3 |
4 files changed, 37 insertions, 10 deletions
diff --git a/openbox/client.h b/openbox/client.h index 5e26ef30..6d018bc6 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -246,6 +246,8 @@ struct _ObClient /*! The window uses shape extension to be non-rectangular? */ gboolean shaped; + /*! The window uses shape extension to have non-rectangular input? */ + gboolean shaped_input; /*! The window is modal, so it must be processed before any windows it is related to can be focused */ diff --git a/openbox/event.c b/openbox/event.c index 30bc656f..f69267db 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1576,11 +1576,24 @@ static void event_handle_client(ObClient *client, XEvent *e) default: ; #ifdef SHAPE - if (obt_display_extension_shape && - e->type == obt_display_extension_shape_basep) { - client->shaped = ((XShapeEvent*)e)->shaped; - frame_adjust_shape(client->frame); + int kind; + if (obt_display_extension_shape && + e->type == obt_display_extension_shape_basep) + { + switch (((XShapeEvent*)e)->kind) { + case ShapeBounding: + case ShapeClip: + client->shaped = ((XShapeEvent*)e)->shaped; + kind = ShapeBounding; + break; + case ShapeInput: + client->shaped_input = ((XShapeEvent*)e)->shaped; + kind = ShapeInput; + break; + } + frame_adjust_shape_kind(client->frame, kind); + } } #endif } diff --git a/openbox/frame.c b/openbox/frame.c index 30630fbb..c633fa6d 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -265,25 +265,26 @@ void frame_adjust_theme(ObFrame *self) set_theme_statics(self); } -void frame_adjust_shape(ObFrame *self) -{ #ifdef SHAPE +void frame_adjust_shape_kind(ObFrame *self, int kind) +{ gint num; XRectangle xrect[2]; - if (!self->client->shaped) { + if (!((kind == ShapeBounding && self->client->shaped) || + (kind == ShapeInput && self->client->shaped_input))) { /* clear the shape on the frame window */ - XShapeCombineMask(obt_display, self->window, ShapeBounding, + XShapeCombineMask(obt_display, self->window, kind, self->size.left, self->size.top, None, ShapeSet); } else { /* make the frame's shape match the clients */ - XShapeCombineShape(obt_display, self->window, ShapeBounding, + XShapeCombineShape(obt_display, self->window, kind, self->size.left, self->size.top, self->client->window, - ShapeBounding, ShapeSet); + kind, ShapeSet); num = 0; if (self->decorations & OB_FRAME_DECOR_TITLEBAR) { @@ -309,6 +310,14 @@ void frame_adjust_shape(ObFrame *self) ShapeBounding, 0, 0, xrect, num, ShapeUnion, Unsorted); } +} +#endif + +void frame_adjust_shape(ObFrame *self) +{ +#ifdef SHAPE + frame_adjust_shape_kind(self, ShapeBounding); + frame_adjust_shape_kind(self, ShapeInput); #endif } diff --git a/openbox/frame.h b/openbox/frame.h index fd5adf74..8687381d 100644 --- a/openbox/frame.h +++ b/openbox/frame.h @@ -205,6 +205,9 @@ void frame_free(ObFrame *self); void frame_show(ObFrame *self); void frame_hide(ObFrame *self); void frame_adjust_theme(ObFrame *self); +#ifdef SHAPE +void frame_adjust_shape_kind(ObFrame *self, int kind); +#endif void frame_adjust_shape(ObFrame *self); void frame_adjust_area(ObFrame *self, gboolean moved, gboolean resized, gboolean fake); |
