Commit 8d5ab6b5 authored by Owen W. Taylor's avatar Owen W. Taylor

Use the correct frame size during unmaximize

When unmaximizing, we changed bits of window state, then called out
to code that used the frame extents *before* we cleared old cached
extents. Clear the cache up-front as soon as we change the window
parent a796938b
...@@ -4060,8 +4060,10 @@ meta_window_unmaximize_internal (MetaWindow *window, ...@@ -4060,8 +4060,10 @@ meta_window_unmaximize_internal (MetaWindow *window,
{ {
MetaRectangle target_rect; MetaRectangle target_rect;
MetaRectangle work_area; MetaRectangle work_area;
MetaRectangle old_rect;
meta_window_get_work_area_for_monitor (window, window->monitor->number, &work_area); meta_window_get_work_area_for_monitor (window, window->monitor->number, &work_area);
meta_window_get_frame_rect (window, &old_rect);
"Unmaximizing %s%s\n", "Unmaximizing %s%s\n",
...@@ -4075,6 +4077,12 @@ meta_window_unmaximize_internal (MetaWindow *window, ...@@ -4075,6 +4077,12 @@ meta_window_unmaximize_internal (MetaWindow *window,
window->maximized_vertically = window->maximized_vertically =
window->maximized_vertically && !unmaximize_vertically; window->maximized_vertically && !unmaximize_vertically;
/* recalc_window_features() will eventually clear the cached frame
* extents, but we need the correct frame extents in the code below,
* so invalidate the old frame extents manually up front.
meta_window_frame_size_changed (window);
/* Unmaximize to the saved_rect position in the direction(s) /* Unmaximize to the saved_rect position in the direction(s)
* being unmaximized. * being unmaximized.
*/ */
...@@ -4119,9 +4127,7 @@ meta_window_unmaximize_internal (MetaWindow *window, ...@@ -4119,9 +4127,7 @@ meta_window_unmaximize_internal (MetaWindow *window,
if (window->display->compositor) if (window->display->compositor)
{ {
MetaRectangle old_rect, new_rect; MetaRectangle new_rect;
meta_window_get_frame_rect (window, &old_rect);
meta_window_move_resize_internal (window, meta_window_move_resize_internal (window,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment