After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 96973 - meta_group_list_windows()
meta_group_list_windows()
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
unspecified
Other other
: High normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks: 93022
 
 
Reported: 2002-10-27 14:46 UTC by Havoc Pennington
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ensure groups computed on meta_group_list_windows (781 bytes, patch)
2003-06-04 05:13 UTC, Rob Adams
none Details | Review
do that OTHER way... (5.61 KB, patch)
2003-06-04 05:54 UTC, Rob Adams
none Details | Review

Description Havoc Pennington 2002-10-27 14:46:44 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.
Comment 1 Heath Harrelson 2002-10-30 15:45:37 UTC
Batch adding GNOME2 keyword to Metacity bugs.  Sorry for the spam.
Comment 2 Rob Adams 2003-06-04 05:13:41 UTC
Created attachment 17122 [details] [review]
ensure groups computed on meta_group_list_windows
Comment 3 Rob Adams 2003-06-04 05:14:52 UTC
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.
Comment 4 Havoc Pennington 2003-06-04 05:20:08 UTC
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.

Comment 5 Rob Adams 2003-06-04 05:54:07 UTC
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.
Comment 6 Rob Adams 2003-06-04 05:54:49 UTC
Created attachment 17123 [details] [review]
do that OTHER way...
Comment 7 Havoc Pennington 2003-06-04 15:37:10 UTC
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.
Comment 8 Rob Adams 2003-06-04 19:29:51 UTC
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