Precompute groups to guarantee that meta_group_list_windows always returns

2003-06-04  Rob Adams  <robadams@ucla.edu>

	Precompute groups to guarantee that meta_group_list_windows always
	returns the correct list of windows.  See Bug #96973

	* src/window.h: change cached_group variable to group

	* src/window.c (meta_window_new): change cached_group to group and
	call meta_window_compute_group

	* src/groups.c (meta_window_get_group): simply return
	window->group rather than computing it and returning
	window->cached_group
	(meta_window_compute_group): new function computes window->group.
	Designed to be called once from meta_window_new
	(remove_window_from_group): change cached_group to group
	(meta_window_group_leader_changed): call meta_window_compute_group
	instead of meta_window_get_group
This commit is contained in:
Rob Adams
2003-06-04 19:15:46 +00:00
committed by Rob Adams
parent 4469a42a77
commit 993c7075f3
5 changed files with 63 additions and 50 deletions

View File

@ -347,6 +347,10 @@ meta_window_new (MetaDisplay *display,
window->display = display;
window->workspaces = NULL;
/* assign the window to its group, or create a new group if needed
*/
meta_window_compute_group (window);
#ifdef HAVE_XSYNC
window->update_counter = None;
#endif
@ -490,7 +494,7 @@ meta_window_new (MetaDisplay *display,
window->top_strut = 0;
window->bottom_strut = 0;
window->cached_group = NULL;
window->group = NULL;
window->using_net_wm_name = FALSE;
window->using_net_wm_icon_name = FALSE;
@ -536,7 +540,7 @@ meta_window_new (MetaDisplay *display,
update_role (window);
update_net_wm_type (window);
meta_window_update_icon_now (window);
if (window->initially_iconic)
{
/* WM_HINTS said minimized */