diff --git a/ChangeLog b/ChangeLog index b90f6335b..3405a0aa1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2007-04-17 Elijah Newren + + 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 Prevent metacity from "forgetting" which machine a window is on. diff --git a/src/window.c b/src/window.c index e47902197..de58c8905 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) @@ -3616,24 +3609,6 @@ meta_window_get_client_root_coords (MetaWindow *window, rect->height = window->rect.height; } -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, diff --git a/src/window.h b/src/window.h index ad6b39e65..71072ca38 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.