Move window repair and reshape to a paint function

Add a paint function that checks all windows for repair and
shape updates; this:

 - simplifies the logic for when a window needs to be repaired
 - avoids duplicate work when we get multiple damage effects
 - avoids the need to look ahead in the event queue

Instead of relying on repair to implicitly resize the
MutterWindow actor, set the size explicitly when the core
code updates the geometry. (This is needed because we haven't
repaired yet when we start an animation, and the animation
may depend on the size to, e.g., rescale from the center.)

Because the core geometry update happens before we start
maximize/unmaximize effects we need to work around this by
passing both the old and new geometry to the compositor.

http://bugzilla.gnome.org/show_bug.cgi?id=587251
This commit is contained in:
Owen W. Taylor
2009-06-28 12:26:23 -04:00
parent bc9a2cc92a
commit 9244f0f113
6 changed files with 178 additions and 70 deletions

View File

@ -2919,14 +2919,18 @@ meta_window_maximize (MetaWindow *window,
if (window->display->compositor)
{
MetaRectangle window_rect;
MetaRectangle old_rect;
MetaRectangle new_rect;
meta_window_get_outer_rect (window, &old_rect);
meta_window_move_resize_now (window);
meta_window_get_outer_rect (window, &window_rect);
meta_window_get_outer_rect (window, &new_rect);
meta_compositor_maximize_window (window->display->compositor,
window,
&window_rect);
&old_rect,
&new_rect);
}
else
{
@ -3035,7 +3039,9 @@ meta_window_unmaximize (MetaWindow *window,
if (window->display->compositor)
{
MetaRectangle window_rect;
MetaRectangle old_rect, new_rect;
meta_window_get_outer_rect (window, &old_rect);
meta_window_move_resize (window,
FALSE,
@ -3043,13 +3049,12 @@ meta_window_unmaximize (MetaWindow *window,
target_rect.y,
target_rect.width,
target_rect.height);
meta_window_move_resize_now (window);
meta_window_get_outer_rect (window, &window_rect);
meta_window_get_outer_rect (window, &new_rect);
meta_compositor_unmaximize_window (window->display->compositor,
window,
&window_rect);
&old_rect,
&new_rect);
}
else
{