diff options
author | Peter Bloomfield <PeterB@src.gnome.org> | 2007-11-13 13:31:14 +0000 |
---|---|---|
committer | Peter Bloomfield <PeterB@src.gnome.org> | 2007-11-13 13:31:14 +0000 |
commit | fa51a94a69d1d6752c4cdd67335e3ea0605eb03a (patch) | |
tree | 0843a107c51eaab29437548d59d405f414db8ed5 | |
parent | ef3f8c18a124eaa54cb002bd8e2b440ddd2525cf (diff) | |
download | metacity-fa51a94a69d1d6752c4cdd67335e3ea0605eb03a.tar.gz |
more changes discussed in bug #461927
svn path=/trunk/; revision=3391
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/window.c | 45 |
2 files changed, 34 insertions, 18 deletions
@@ -1,3 +1,10 @@ +2007-11-13 Peter Bloomfield <pbloomfield@bellsouth.net> + + * src/window.c: (meta_window_save_user_rect): new helper, saves + only unmaximized dimensions, and not when fullscreen. + (meta_window_move_resize_internal, + meta_window_move_resize_request): use it. (#461927) + 2007-11-11 Thomas Thurman <thomas@thurman.org.uk> * configure.in: Post-release bump to 2.21.2. diff --git a/src/window.c b/src/window.c index d26d38f4..bcedd84e 100644 --- a/src/window.c +++ b/src/window.c @@ -75,6 +75,7 @@ static void meta_window_show (MetaWindow *window); static void meta_window_hide (MetaWindow *window); static void meta_window_save_rect (MetaWindow *window); +static void meta_window_save_user_rect (MetaWindow *window); static void meta_window_move_resize_internal (MetaWindow *window, MetaMoveResizeFlags flags, @@ -2431,6 +2432,30 @@ meta_window_save_rect (MetaWindow *window) } } +static void +meta_window_save_user_rect (MetaWindow *window) +{ + /* We do not save maximized or fullscreen dimensions, otherwise the + * window may snap back to those dimensions (Bug #461927). */ + if (!(META_WINDOW_MAXIMIZED (window) || window->fullscreen)) + { + MetaRectangle user_rect; + + meta_window_get_client_root_coords (window, &user_rect); + + if (!window->maximized_horizontally) + { + window->user_rect.x = user_rect.x; + window->user_rect.width = user_rect.width; + } + if (!window->maximized_vertically) + { + window->user_rect.y = user_rect.y; + window->user_rect.height = user_rect.height; + } + } +} + void meta_window_maximize_internal (MetaWindow *window, MetaMaximizeFlags directions, @@ -3506,23 +3531,7 @@ meta_window_move_resize_internal (MetaWindow *window, * placement of the window. */ if (is_user_action || !window->placed) - { - MetaRectangle user_rect; - - meta_window_get_client_root_coords (window, &user_rect); - - if (!window->maximized_horizontally) - { - window->user_rect.x = user_rect.x; - window->user_rect.width = user_rect.width; - } - - if (!window->maximized_vertically) - { - window->user_rect.y = user_rect.y; - window->user_rect.height = user_rect.height; - } - } + meta_window_save_user_rect(window); if (need_move_frame || need_resize_frame || need_move_client || need_resize_client) @@ -4566,7 +4575,7 @@ meta_window_move_resize_request (MetaWindow *window, * * See also bug 426519. */ - meta_window_get_client_root_coords (window, &window->user_rect); + meta_window_save_user_rect(window); } gboolean |