summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorElijah Newren <newren gmail com>2007-04-04 03:07:26 +0000
committerElijah Newren <newren@src.gnome.org>2007-04-04 03:07:26 +0000
commit7a799b3a6356be3b44dc249786fe31b7a4fb713d (patch)
treed96bb32ac21526db71ac7dae8cd3bef5eaf34370 /src
parentb01dcaa3387118081e82c49d8a1ccf3284f21d98 (diff)
downloadmetacity-7a799b3a6356be3b44dc249786fe31b7a4fb713d.tar.gz
Only use saved_rect for determining the position to unmaximize to for the
2007-04-03 Elijah Newren <newren gmail com> * src/window.c (meta_window_unmaximize): Only use saved_rect for determining the position to unmaximize to for the previously-maximized direction(s). Fixes #355497. svn path=/trunk/; revision=3154
Diffstat (limited to 'src')
-rw-r--r--src/window.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/window.c b/src/window.c
index 2f94a998..d670b31d 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2394,6 +2394,8 @@ meta_window_unmaximize (MetaWindow *window,
if ((unmaximize_horizontally && window->maximized_horizontally) ||
(unmaximize_vertically && window->maximized_vertically))
{
+ MetaRectangle target_rect;
+
meta_topic (META_DEBUG_WINDOW_OPS,
"Unmaximizing %s%s\n",
window->desc,
@@ -2406,6 +2408,22 @@ meta_window_unmaximize (MetaWindow *window,
window->maximized_vertically =
window->maximized_vertically && !unmaximize_vertically;
+ /* Unmaximize to the saved_rect position in the direction(s)
+ * being unmaximized.
+ */
+ target_rect = window->rect;
+ meta_window_get_position (window, &target_rect.x, &target_rect.y);
+ if (unmaximize_horizontally)
+ {
+ target_rect.x = window->saved_rect.x;
+ target_rect.width = window->saved_rect.width;
+ }
+ if (unmaximize_vertically)
+ {
+ target_rect.y = window->saved_rect.y;
+ target_rect.height = window->saved_rect.height;
+ }
+
/* When we unmaximize, if we're doing a mouse move also we could
* get the window suddenly jumping to the upper left corner of
* the workspace, since that's where it was when the grab op
@@ -2414,19 +2432,19 @@ meta_window_unmaximize (MetaWindow *window,
if (meta_grab_op_is_moving (window->display->grab_op) &&
window->display->grab_window == window)
{
- window->display->grab_anchor_window_pos = window->saved_rect;
+ window->display->grab_anchor_window_pos = target_rect;
}
meta_window_move_resize (window,
FALSE,
- window->saved_rect.x,
- window->saved_rect.y,
- window->saved_rect.width,
- window->saved_rect.height);
+ target_rect.x,
+ target_rect.y,
+ target_rect.width,
+ target_rect.height);
if (window->display->grab_wireframe_active)
{
- window->display->grab_wireframe_rect = window->saved_rect;
+ window->display->grab_wireframe_rect = target_rect;
}
recalc_window_features (window);