summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2013-12-05 08:27:28 -0500
committerOwen W. Taylor <otaylor@fishsoup.net>2013-12-05 11:15:23 -0500
commit3283018bfbefea0664deac42d4180cbc374c5ab6 (patch)
tree424c11abb0ea7ca5b6406cebf391ebc9aa26bc1f
parent55226ada8a019b4e5bb9b0dd5d9efce07d1084dd (diff)
downloadmutter-3283018bfbefea0664deac42d4180cbc374c5ab6.tar.gz
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 state. https://bugzilla.gnome.org/show_bug.cgi?id=714707
-rw-r--r--src/core/window.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/window.c b/src/core/window.c
index cf1701dfd..b9f4455f0 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -3900,8 +3900,10 @@ meta_window_unmaximize_internal (MetaWindow *window,
{
MetaRectangle target_rect;
MetaRectangle work_area;
+ MetaRectangle old_rect;
meta_window_get_work_area_for_monitor (window, window->monitor->number, &work_area);
+ meta_window_get_frame_rect (window, &old_rect);
meta_topic (META_DEBUG_WINDOW_OPS,
"Unmaximizing %s%s\n",
@@ -3915,6 +3917,12 @@ meta_window_unmaximize_internal (MetaWindow *window,
window->maximized_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)
* being unmaximized.
*/
@@ -3959,9 +3967,7 @@ meta_window_unmaximize_internal (MetaWindow *window,
if (window->display->compositor)
{
- MetaRectangle old_rect, new_rect;
-
- meta_window_get_frame_rect (window, &old_rect);
+ MetaRectangle new_rect;
meta_window_move_resize_internal (window,
META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION,