mirror of
https://github.com/brl/mutter.git
synced 2024-11-13 09:46:08 -05:00
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:
parent
e8b0c11703
commit
d900d83522
@ -1198,7 +1198,8 @@ meta_compositor_window_unmapped (MetaCompositor *compositor,
|
||||
|
||||
void
|
||||
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));
|
||||
MetaScreen *screen = meta_window_get_screen (window);
|
||||
@ -1210,7 +1211,7 @@ meta_compositor_sync_window_geometry (MetaCompositor *compositor,
|
||||
if (!window_actor)
|
||||
return;
|
||||
|
||||
meta_window_actor_sync_actor_position (window_actor);
|
||||
meta_window_actor_sync_actor_geometry (window_actor, did_placement);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -43,7 +43,8 @@ void meta_window_actor_get_shape_bounds (MetaWindowActor *self,
|
||||
cairo_rectangle_int_t *bounds);
|
||||
|
||||
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_update_shape (MetaWindowActor *self);
|
||||
void meta_window_actor_update_opacity (MetaWindowActor *self);
|
||||
|
@ -951,8 +951,8 @@ meta_window_actor_thaw (MetaWindowActor *self)
|
||||
if (self->priv->freeze_count)
|
||||
return;
|
||||
|
||||
/* We ignore moves and resizes on frozen windows */
|
||||
meta_window_actor_sync_actor_position (self);
|
||||
/* We sometimes ignore moves and resizes on frozen windows */
|
||||
meta_window_actor_sync_actor_geometry (self, FALSE);
|
||||
|
||||
/* We do this now since we might be going right back into the
|
||||
* frozen state */
|
||||
@ -1121,7 +1121,7 @@ meta_window_actor_after_effects (MetaWindowActor *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))
|
||||
meta_window_actor_detach (self);
|
||||
@ -1370,11 +1370,22 @@ meta_window_actor_destroy (MetaWindowActor *self)
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_actor_sync_actor_position (MetaWindowActor *self)
|
||||
meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
|
||||
gboolean did_placement)
|
||||
{
|
||||
MetaWindowActorPrivate *priv = self->priv;
|
||||
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);
|
||||
|
||||
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_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 */
|
||||
meta_window_set_compositor_private (window, G_OBJECT (self));
|
||||
|
@ -4775,6 +4775,7 @@ meta_window_move_resize_internal (MetaWindow *window,
|
||||
gboolean is_configure_request;
|
||||
gboolean do_gravity_adjust;
|
||||
gboolean is_user_action;
|
||||
gboolean did_placement;
|
||||
gboolean configure_frame_first;
|
||||
gboolean use_static_gravity;
|
||||
/* 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);
|
||||
}
|
||||
|
||||
did_placement = !window->placed && window->calc_placement;
|
||||
|
||||
meta_window_constrain (window,
|
||||
window->frame ? &borders : NULL,
|
||||
flags,
|
||||
@ -5161,7 +5164,8 @@ meta_window_move_resize_internal (MetaWindow *window,
|
||||
save_user_window_placement (window);
|
||||
|
||||
if (need_move_frame || need_resize_frame ||
|
||||
need_move_client || need_resize_client)
|
||||
need_move_client || need_resize_client ||
|
||||
did_placement)
|
||||
{
|
||||
int 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);
|
||||
if (window->display->compositor)
|
||||
meta_compositor_sync_window_geometry (window->display->compositor,
|
||||
window);
|
||||
window,
|
||||
did_placement);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -5506,7 +5511,7 @@ meta_window_configure_notify (MetaWindow *window,
|
||||
meta_warning ("Unhandled change of windows override redirect status\n");
|
||||
|
||||
if (window->display->compositor)
|
||||
meta_compositor_sync_window_geometry (window->display->compositor, window);
|
||||
meta_compositor_sync_window_geometry (window->display->compositor, window, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -152,7 +152,8 @@ void meta_compositor_window_mapped (MetaCompositor *compositor,
|
||||
void meta_compositor_window_unmapped (MetaCompositor *compositor,
|
||||
MetaWindow *window);
|
||||
void meta_compositor_sync_window_geometry (MetaCompositor *compositor,
|
||||
MetaWindow *window);
|
||||
MetaWindow *window,
|
||||
gboolean did_placement);
|
||||
void meta_compositor_set_updates_frozen (MetaCompositor *compositor,
|
||||
MetaWindow *window,
|
||||
gboolean updates_frozen);
|
||||
|
Loading…
Reference in New Issue
Block a user