GNOME Bugzilla – Bug 96973
meta_group_list_windows()
Last modified: 2004-12-22 21:47:04 UTC
Because we only lazily add windows to groups, meta_group_list_windows() doesn't really return all the group members. Need to go ahead and precompute the groups.
Batch adding GNOME2 keyword to Metacity bugs. Sorry for the spam.
Created attachment 17122 [details] [review] ensure groups computed on meta_group_list_windows
Fairly easy. I just call meta_window_get_group on each window on the display to ensure that all groups have been calculated when the list is returned.
I think it's probably too inefficient to iterate over all windows every time we get the windows in a group - I would think about doing this by just computing each window's group when that window is created, in meta_window_new(). I'd go ahead and add meta_window_compute_group (window), and also rename window->cached_group to window->group. Then I'd make meta_window_get_group() call compute_group if window->group == NULL.
I don't know that it's too bad. I mean, it's just a no-op most of the time. But anyway here's a patch to do it the other way. I usually like to try lower-impact things first, as you may have noticed, but this should be fairly safe.
Created attachment 17123 [details] [review] do that OTHER way...
Looks good, thanks. Sometimes a larger change leaves things making more sense when you read the code, and I think that's usually worth it. In meta_window_get_group(), I'd add one of: - g_assert (window->group != NULL) or - meta_window_compute_group (window) Just to be sure we don't use get_group() somewhere in meta_window_new() prior to computing the group. Anyway, good to commit.
OK after a fiasco involving me committing a broken version of the patch, then rolling it back, committing what turned out to be a partial solution, then finally committing the full solution (with a g_assert (window->group != NULL), this bug can now be closed. I need more caffeine. Or less. Or something. -Rob