don't be stupid and set window->group = NULL after calling

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

	* src/window.c (meta_window_new): don't be stupid and set
	window->group = NULL after calling meta_window_compute_group.

	* src/group.c (meta_window_get_group): assert that window->group
	!= NULL in here instead of computing the group to ensure
	robustness.
This commit is contained in:
Rob Adams 2003-06-04 19:28:19 +00:00 committed by Rob Adams
parent 993c7075f3
commit 85abc9bfe7
3 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,12 @@
2003-06-04 Rob Adams <robadams@ucla.edu>
* src/window.c (meta_window_new): don't be stupid and set
window->group = NULL after calling meta_window_compute_group.
* src/group.c (meta_window_get_group): assert that window->group
!= NULL in here instead of computing the group to ensure
robustness.
2003-06-04 Rob Adams <robadams@ucla.edu>
Precompute groups to guarantee that meta_group_list_windows always

View File

@ -106,8 +106,7 @@ meta_window_get_group (MetaWindow *window)
if (window->unmanaging)
return NULL;
if (window->group == NULL)
meta_window_compute_group (window);
g_assert (window->group != NULL);
return window->group;
}

View File

@ -349,6 +349,7 @@ meta_window_new (MetaDisplay *display,
/* assign the window to its group, or create a new group if needed
*/
window->group = NULL;
meta_window_compute_group (window);
#ifdef HAVE_XSYNC
@ -494,8 +495,6 @@ meta_window_new (MetaDisplay *display,
window->top_strut = 0;
window->bottom_strut = 0;
window->group = NULL;
window->using_net_wm_name = FALSE;
window->using_net_wm_icon_name = FALSE;