From 3d337a98d95b6fd5e4f0bee9dbdc0d45a24b25a1 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 15 Feb 2013 15:53:04 -0500 Subject: [PATCH] MetaWindowActor: Freeze shouldn't affect actor position If a window is frozen because it is repainting, that shouldn't kee[p us from updating its position: we don't want a slow-to-update window to move around the screen chunkily when dragged. (This does reduce the efficiency of begin/end frames for replacing double-buffering, but that never works very well in the case where there was an overlapping window or the entire screen needed redrawing for whatever reason.) This fixes a bug where a window that was mapped frozen would not get positioned properly until after the map effect finished, and would jump from 0,0 at that point. Since effects *do* need to prevent actor repositioning by Mutter, we must position the actor before any effect starts. Because we now are queuing invalidates on frozen windows, fix the logic for that so that we properly update everything when the window unfreezes. https://bugzilla.gnome.org/show_bug.cgi?id=693922 --- src/compositor/meta-window-actor.c | 36 ++++++++++++++++++------------ 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index 013a8ec66..eec18c947 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -1012,6 +1012,12 @@ meta_window_actor_effect_in_progress (MetaWindowActor *self) self->priv->destroy_in_progress); } +static gboolean +is_frozen (MetaWindowActor *self) +{ + return self->priv->freeze_count ? TRUE : FALSE; +} + static void meta_window_actor_queue_create_pixmap (MetaWindowActor *self) { @@ -1022,6 +1028,9 @@ meta_window_actor_queue_create_pixmap (MetaWindowActor *self) if (!priv->mapped) return; + if (is_frozen (self)) + return; + /* This will cause the compositor paint function to be run * if the actor is visible or a clone of the actor is visible. * if the actor isn't visible in any way, then we don't @@ -1360,12 +1369,6 @@ meta_window_actor_destroy (MetaWindowActor *self) clutter_actor_destroy (CLUTTER_ACTOR (self)); } -static gboolean -is_frozen (MetaWindowActor *self) -{ - return self->priv->freeze_count ? TRUE : FALSE; -} - void meta_window_actor_sync_actor_position (MetaWindowActor *self) { @@ -1374,9 +1377,6 @@ meta_window_actor_sync_actor_position (MetaWindowActor *self) meta_window_get_input_rect (priv->window, &window_rect); - if (is_frozen (self)) - return; - if (priv->last_width != window_rect.width || priv->last_height != window_rect.height) { @@ -2202,6 +2202,12 @@ check_needs_reshape (MetaWindowActor *self) if (!priv->needs_reshape) return; + if (priv->shadow_shape != NULL) + { + meta_window_shape_unref (priv->shadow_shape); + priv->shadow_shape = NULL; + } + meta_frame_calc_borders (priv->window->frame, &borders); client_area.x = borders.total.left; @@ -2315,11 +2321,9 @@ meta_window_actor_update_shape (MetaWindowActor *self) MetaWindowActorPrivate *priv = self->priv; priv->needs_reshape = TRUE; - if (priv->shadow_shape != NULL) - { - meta_window_shape_unref (priv->shadow_shape); - priv->shadow_shape = NULL; - } + + if (is_frozen (self)) + return; clutter_actor_queue_redraw (priv->actor); } @@ -2520,6 +2524,10 @@ meta_window_actor_invalidate_shadow (MetaWindowActor *self) priv->recompute_focused_shadow = TRUE; priv->recompute_unfocused_shadow = TRUE; + + if (is_frozen (self)) + return; + clutter_actor_queue_redraw (CLUTTER_ACTOR (self)); }