MetaWindowActor: Go back to freezing affecting actor geometry

We do, in fact, need freezing to affect window geometry, so that
move-resize operations (such as an interactive resize from the
left, or a resize of a popup centered by the application) occur
atomically.

So to make map effects work properly, only exclude the initial
placement of a window from freezing. (In the future, we may want
to consider whether pure moves of a window being done in response
to a user drag should also be excluded from freezing.)

Rename meta_window_sync_actor_position() to
meta_window_sync_actor_geometry() for clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=693922
This commit is contained in:
Owen W. Taylor 2013-02-15 21:27:00 -05:00
parent e8b0c11703
commit d900d83522
5 changed files with 31 additions and 12 deletions

View File

@ -1198,7 +1198,8 @@ meta_compositor_window_unmapped (MetaCompositor *compositor,
void void
meta_compositor_sync_window_geometry (MetaCompositor *compositor, meta_compositor_sync_window_geometry (MetaCompositor *compositor,
MetaWindow *window) MetaWindow *window,
gboolean did_placement)
{ {
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window)); MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
MetaScreen *screen = meta_window_get_screen (window); MetaScreen *screen = meta_window_get_screen (window);
@ -1210,7 +1211,7 @@ meta_compositor_sync_window_geometry (MetaCompositor *compositor,
if (!window_actor) if (!window_actor)
return; return;
meta_window_actor_sync_actor_position (window_actor); meta_window_actor_sync_actor_geometry (window_actor, did_placement);
} }
void void

View File

@ -43,7 +43,8 @@ void meta_window_actor_get_shape_bounds (MetaWindowActor *self,
cairo_rectangle_int_t *bounds); cairo_rectangle_int_t *bounds);
gboolean meta_window_actor_effect_in_progress (MetaWindowActor *self); gboolean meta_window_actor_effect_in_progress (MetaWindowActor *self);
void meta_window_actor_sync_actor_position (MetaWindowActor *self); void meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
gboolean did_placement);
void meta_window_actor_sync_visibility (MetaWindowActor *self); void meta_window_actor_sync_visibility (MetaWindowActor *self);
void meta_window_actor_update_shape (MetaWindowActor *self); void meta_window_actor_update_shape (MetaWindowActor *self);
void meta_window_actor_update_opacity (MetaWindowActor *self); void meta_window_actor_update_opacity (MetaWindowActor *self);

View File

@ -951,8 +951,8 @@ meta_window_actor_thaw (MetaWindowActor *self)
if (self->priv->freeze_count) if (self->priv->freeze_count)
return; return;
/* We ignore moves and resizes on frozen windows */ /* We sometimes ignore moves and resizes on frozen windows */
meta_window_actor_sync_actor_position (self); meta_window_actor_sync_actor_geometry (self, FALSE);
/* We do this now since we might be going right back into the /* We do this now since we might be going right back into the
* frozen state */ * frozen state */
@ -1121,7 +1121,7 @@ meta_window_actor_after_effects (MetaWindowActor *self)
} }
meta_window_actor_sync_visibility (self); meta_window_actor_sync_visibility (self);
meta_window_actor_sync_actor_position (self); meta_window_actor_sync_actor_geometry (self, FALSE);
if (!meta_window_is_mapped (priv->window)) if (!meta_window_is_mapped (priv->window))
meta_window_actor_detach (self); meta_window_actor_detach (self);
@ -1370,11 +1370,22 @@ meta_window_actor_destroy (MetaWindowActor *self)
} }
void void
meta_window_actor_sync_actor_position (MetaWindowActor *self) meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
gboolean did_placement)
{ {
MetaWindowActorPrivate *priv = self->priv; MetaWindowActorPrivate *priv = self->priv;
MetaRectangle window_rect; MetaRectangle window_rect;
/* Normally we want freezing a window to also freeze its position; this allows
* windows to atomically move and resize together, either under app control,
* or because the user is resizing from the left/top. But on initial placement
* we need to assign a position, since immediately after the window
* is shown, the map effect will go into effect and prevent further geometry
* updates.
*/
if (is_frozen (self) && !did_placement)
return;
meta_window_get_input_rect (priv->window, &window_rect); meta_window_get_input_rect (priv->window, &window_rect);
if (priv->last_width != window_rect.width || if (priv->last_width != window_rect.width ||
@ -1578,7 +1589,7 @@ meta_window_actor_new (MetaWindow *window)
meta_window_actor_set_updates_frozen (self, meta_window_actor_set_updates_frozen (self,
meta_window_updates_are_frozen (priv->window)); meta_window_updates_are_frozen (priv->window));
meta_window_actor_sync_actor_position (self); meta_window_actor_sync_actor_geometry (self, priv->window->placed);
/* Hang our compositor window state off the MetaWindow for fast retrieval */ /* Hang our compositor window state off the MetaWindow for fast retrieval */
meta_window_set_compositor_private (window, G_OBJECT (self)); meta_window_set_compositor_private (window, G_OBJECT (self));

View File

@ -4775,6 +4775,7 @@ meta_window_move_resize_internal (MetaWindow *window,
gboolean is_configure_request; gboolean is_configure_request;
gboolean do_gravity_adjust; gboolean do_gravity_adjust;
gboolean is_user_action; gboolean is_user_action;
gboolean did_placement;
gboolean configure_frame_first; gboolean configure_frame_first;
gboolean use_static_gravity; gboolean use_static_gravity;
/* used for the configure request, but may not be final /* used for the configure request, but may not be final
@ -4848,6 +4849,8 @@ meta_window_move_resize_internal (MetaWindow *window,
new_rect.x, new_rect.y); new_rect.x, new_rect.y);
} }
did_placement = !window->placed && window->calc_placement;
meta_window_constrain (window, meta_window_constrain (window,
window->frame ? &borders : NULL, window->frame ? &borders : NULL,
flags, flags,
@ -5161,7 +5164,8 @@ meta_window_move_resize_internal (MetaWindow *window,
save_user_window_placement (window); save_user_window_placement (window);
if (need_move_frame || need_resize_frame || if (need_move_frame || need_resize_frame ||
need_move_client || need_resize_client) need_move_client || need_resize_client ||
did_placement)
{ {
int newx, newy; int newx, newy;
meta_window_get_position (window, &newx, &newy); meta_window_get_position (window, &newx, &newy);
@ -5172,7 +5176,8 @@ meta_window_move_resize_internal (MetaWindow *window,
window->user_rect.width, window->user_rect.height); window->user_rect.width, window->user_rect.height);
if (window->display->compositor) if (window->display->compositor)
meta_compositor_sync_window_geometry (window->display->compositor, meta_compositor_sync_window_geometry (window->display->compositor,
window); window,
did_placement);
} }
else else
{ {
@ -5506,7 +5511,7 @@ meta_window_configure_notify (MetaWindow *window,
meta_warning ("Unhandled change of windows override redirect status\n"); meta_warning ("Unhandled change of windows override redirect status\n");
if (window->display->compositor) if (window->display->compositor)
meta_compositor_sync_window_geometry (window->display->compositor, window); meta_compositor_sync_window_geometry (window->display->compositor, window, FALSE);
} }
void void

View File

@ -152,7 +152,8 @@ void meta_compositor_window_mapped (MetaCompositor *compositor,
void meta_compositor_window_unmapped (MetaCompositor *compositor, void meta_compositor_window_unmapped (MetaCompositor *compositor,
MetaWindow *window); MetaWindow *window);
void meta_compositor_sync_window_geometry (MetaCompositor *compositor, void meta_compositor_sync_window_geometry (MetaCompositor *compositor,
MetaWindow *window); MetaWindow *window,
gboolean did_placement);
void meta_compositor_set_updates_frozen (MetaCompositor *compositor, void meta_compositor_set_updates_frozen (MetaCompositor *compositor,
MetaWindow *window, MetaWindow *window,
gboolean updates_frozen); gboolean updates_frozen);