diff options
author | Elijah Newren <newren gmail com> | 2007-04-18 05:43:42 +0000 |
---|---|---|
committer | Elijah Newren <newren@src.gnome.org> | 2007-04-18 05:43:42 +0000 |
commit | e66919510f84064a763e46d9393e30cb137f8fe7 (patch) | |
tree | 43877845c49cba5f4e1c4777303136fe0a0c31de | |
parent | 966e36b9f6c880fb9f925d290123fcec2619f90a (diff) | |
download | metacity-e66919510f84064a763e46d9393e30cb137f8fe7.tar.gz |
Fix some fallout from #426519; update user_rect for all position changes
2007-04-17 Elijah Newren <newren gmail com>
Fix some fallout from #426519; update user_rect for all position
changes prior to the window being marked as placed. Prevents
emacs in particular from flickering on start and always being
shoved to the upper-left corner.
* src/window.c (meta_window_move_resize_internal):
Record position in user_rect if the window is not yet marked as
placed too
* src/window.c (struct MetaWindow, meta_window_new_with_attrs,
meta_window_move_resize_internal):
Remove window->user_has_move_resized; it's not needed or used
anymore.
* src/window.[ch] (meta_window_get_user_position):
Remove this function as it is no longer needed or used.
svn path=/trunk/; revision=3203
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | src/window.c | 37 | ||||
-rw-r--r-- | src/window.h | 8 |
3 files changed, 25 insertions, 39 deletions
@@ -1,3 +1,22 @@ +2007-04-17 Elijah Newren <newren gmail com> + + Fix some fallout from #426519; update user_rect for all position + changes prior to the window being marked as placed. Prevents + emacs in particular from flickering on start and always being + shoved to the upper-left corner. + + * src/window.c (meta_window_move_resize_internal): + Record position in user_rect if the window is not yet marked as + placed too + + * src/window.c (struct MetaWindow, meta_window_new_with_attrs, + meta_window_move_resize_internal): + Remove window->user_has_move_resized; it's not needed or used + anymore. + + * src/window.[ch] (meta_window_get_user_position): + Remove this function as it is no longer needed or used. + 2007-04-16 Elijah Newren <newren gmail com> Prevent metacity from "forgetting" which machine a window is on. diff --git a/src/window.c b/src/window.c index e4790219..de58c890 100644 --- a/src/window.c +++ b/src/window.c @@ -440,8 +440,6 @@ meta_window_new_with_attrs (MetaDisplay *display, window->frame = NULL; window->has_focus = FALSE; - window->user_has_move_resized = FALSE; - window->maximized_horizontally = FALSE; window->maximized_vertically = FALSE; window->maximize_horizontally_after_placement = FALSE; @@ -3367,17 +3365,12 @@ meta_window_move_resize_internal (MetaWindow *window, if (need_configure_notify) send_configure_notify (window); - if (is_user_action) - { - window->user_has_move_resized = TRUE; - - window->user_rect.width = window->rect.width; - window->user_rect.height = window->rect.height; - - meta_window_get_position (window, - &window->user_rect.x, - &window->user_rect.y); - } + /* user_rect is the position to restore towards if strut changes occur. Thus + * we want user_rect to reflect user position/size changes OR the initial + * placement of the window. + */ + if (is_user_action || !window->placed) + meta_window_get_client_root_coords (window, &window->user_rect); if (need_move_frame || need_resize_frame || need_move_client || need_resize_client) @@ -3617,24 +3610,6 @@ meta_window_get_client_root_coords (MetaWindow *window, } void -meta_window_get_user_position (MetaWindow *window, - int *x, - int *y) -{ - if (window->user_has_move_resized) - { - if (x) - *x = window->user_rect.x; - if (y) - *y = window->user_rect.y; - } - else - { - meta_window_get_position (window, x, y); - } -} - -void meta_window_get_gravity_position (MetaWindow *window, int gravity, int *root_x, diff --git a/src/window.h b/src/window.h index ad6b39e6..71072ca3 100644 --- a/src/window.h +++ b/src/window.h @@ -221,11 +221,6 @@ struct _MetaWindow */ guint has_focus : 1; - /* Track whether the user has ever manually modified - * the window; if so, we can use the saved user size/pos - */ - guint user_has_move_resized : 1; - /* Have we placed this window? */ guint placed : 1; @@ -454,9 +449,6 @@ void meta_window_update_struts (MetaWindow *window); void meta_window_get_position (MetaWindow *window, int *x, int *y); -void meta_window_get_user_position (MetaWindow *window, - int *x, - int *y); /* Gets root coords for x, y, width & height of client window; uses * meta_window_get_position for x & y. |