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
This commit is contained in:
Elijah Newren 2007-04-18 05:43:42 +00:00 committed by Elijah Newren
parent 966e36b9f6
commit e66919510f
3 changed files with 25 additions and 39 deletions

View File

@ -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> 2007-04-16 Elijah Newren <newren gmail com>
Prevent metacity from "forgetting" which machine a window is on. Prevent metacity from "forgetting" which machine a window is on.

View File

@ -440,8 +440,6 @@ meta_window_new_with_attrs (MetaDisplay *display,
window->frame = NULL; window->frame = NULL;
window->has_focus = FALSE; window->has_focus = FALSE;
window->user_has_move_resized = FALSE;
window->maximized_horizontally = FALSE; window->maximized_horizontally = FALSE;
window->maximized_vertically = FALSE; window->maximized_vertically = FALSE;
window->maximize_horizontally_after_placement = FALSE; window->maximize_horizontally_after_placement = FALSE;
@ -3367,17 +3365,12 @@ meta_window_move_resize_internal (MetaWindow *window,
if (need_configure_notify) if (need_configure_notify)
send_configure_notify (window); send_configure_notify (window);
if (is_user_action) /* 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
window->user_has_move_resized = TRUE; * placement of the window.
*/
window->user_rect.width = window->rect.width; if (is_user_action || !window->placed)
window->user_rect.height = window->rect.height; meta_window_get_client_root_coords (window, &window->user_rect);
meta_window_get_position (window,
&window->user_rect.x,
&window->user_rect.y);
}
if (need_move_frame || need_resize_frame || if (need_move_frame || need_resize_frame ||
need_move_client || need_resize_client) need_move_client || need_resize_client)
@ -3616,24 +3609,6 @@ meta_window_get_client_root_coords (MetaWindow *window,
rect->height = window->rect.height; 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 void
meta_window_get_gravity_position (MetaWindow *window, meta_window_get_gravity_position (MetaWindow *window,
int gravity, int gravity,

View File

@ -221,11 +221,6 @@ struct _MetaWindow
*/ */
guint has_focus : 1; 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? */ /* Have we placed this window? */
guint placed : 1; guint placed : 1;
@ -454,9 +449,6 @@ void meta_window_update_struts (MetaWindow *window);
void meta_window_get_position (MetaWindow *window, void meta_window_get_position (MetaWindow *window,
int *x, int *x,
int *y); 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 /* Gets root coords for x, y, width & height of client window; uses
* meta_window_get_position for x & y. * meta_window_get_position for x & y.