summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2007-11-14 00:44:59 +0000
committerIain Holmes <iain@src.gnome.org>2007-11-14 00:44:59 +0000
commit0e849c06645d415563fca937823b492e3877da04 (patch)
tree363387b53a41c3e3a404902c375b7c2249189694
parent99e5be1e7e019df3b14d4d6e5c71324a8f5c73b3 (diff)
downloadmetacity-0e849c06645d415563fca937823b492e3877da04.tar.gz
Fix a shaped window glitch
svn path=/branches/iains-blingtastic-bucket-o-bling/; revision=3396
-rw-r--r--src/compositor.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/compositor.c b/src/compositor.c
index 7a5764af..58b67cec 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1128,6 +1128,25 @@ determine_mode (MetaDisplay *display,
}
}
+static gboolean
+is_shaped (MetaDisplay *display,
+ Window xwindow)
+{
+ int xws, yws, xbs, ybs;
+ unsigned wws, hws, wbs, hbs;
+ int bounding_shaped, clip_shaped;
+
+ if (META_DISPLAY_HAS_SHAPE (display))
+ {
+ XShapeQueryExtents (display->xdisplay, xwindow, &bounding_shaped,
+ &xws, &yws, &wws, &hws, &clip_shaped,
+ &xbs, &ybs, &wbs, &hbs);
+ return (bounding_shaped != 0);
+ }
+
+ return FALSE;
+}
+
static void
add_win (MetaScreen *screen,
Window xwindow)
@@ -1155,6 +1174,7 @@ add_win (MetaScreen *screen,
#endif
cw->damaged = FALSE;
+ cw->shaped = is_shaped (display, xwindow);
if (cw->attrs.class == InputOnly) {
cw->damage = None;
@@ -1490,6 +1510,26 @@ static void
process_shape (MetaCompositor *compositor,
XShapeEvent *event)
{
+ MetaCompWindow *cw = find_window_in_display (compositor->display,
+ event->window);
+
+ if (cw == NULL) {
+ return;
+ }
+
+ if (event->kind == ShapeBounding) {
+ if (!event->shaped && cw->shaped) {
+ cw->shaped = FALSE;
+ }
+
+ resize_win (cw, cw->attrs.x, cw->attrs.y,
+ event->width + event->x, event->height + event->y,
+ cw->attrs.border_width, cw->attrs.override_redirect);
+
+ if (event->shaped && !cw->shaped) {
+ cw->shaped = TRUE;
+ }
+ }
}
MetaCompositor *