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 336184 - More inclusive window groupings
More inclusive window groupings
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
trunk
Other Linux
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2006-03-27 13:18 UTC by Björn Lindqvist
Modified: 2006-03-30 19:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fixes better groupings (3.49 KB, patch)
2006-03-27 13:19 UTC, Björn Lindqvist
reviewed Details | Review
Alternative fix, by allowing the inclusive grouping that used to exist but was broken by patch in bug 328211 (1.82 KB, patch)
2006-03-28 22:42 UTC, Elijah Newren
none Details | Review
Fixed fix to 328211 ;-) (3.59 KB, patch)
2006-03-30 19:06 UTC, Elijah Newren
committed Details | Review

Description Björn Lindqvist 2006-03-27 13:18:32 UTC
Below is a patch which is supposed to make MetaGroup's more
inclusive. It is supposed to help the patch on Bug #94682. Without
this patch, Alt+F6 doesn't include all windows in an application. See
comment #25 for examples where that is problematic. The patch fixes
that without any negative side-effects that I have seen so far.

The grouping behaviour is still not optimal. For example, two separate
Firefox windows (or two Nautilus windows) are thrown in the same group
because they both share the xgroup_leader window. It seems like it
might be very hard to fix that problem.
Comment 1 Björn Lindqvist 2006-03-27 13:19:15 UTC
Created attachment 62117 [details] [review]
fixes better groupings
Comment 2 Elijah Newren 2006-03-28 22:35:05 UTC
I believe group.c was supposed to already do that; I just didn't catch the bug in Thomas' patch in bug 328211.  I'll attach a patch which makes transiency correctly override grouping and which fixes the behavior you saw in bug 94682.
Comment 3 Elijah Newren 2006-03-28 22:42:14 UTC
Created attachment 62250 [details] [review]
Alternative fix, by allowing the inclusive grouping that used to exist but was broken by patch in bug 328211
Comment 4 Thomas Thurman 2006-03-29 00:57:56 UTC
Sorry about that. What was the bug?
Comment 5 Elijah Newren 2006-03-29 01:31:58 UTC
Thomas:  No worries, I missed it too when I was reviewing it.  The goal of your patch was to have transiency override the normal grouping; but instead of using the ancestor's group in such cases, your patch used the ancestor _as_ the group.  This fails because the group_leader is a special window that isn't an existing top_level window in most cases while the transient_for hint always is (for non-buggy apps, anyway).
Comment 6 Havoc Pennington 2006-03-30 06:06:56 UTC
When walking up xtransient_for, I think in some places we were using tortoise-and-hare to avoid getting in infinite loops. Would it be appropriate to use that bit of paranoia here also?

I don't see anything obviously broken about the patch in general.
Comment 7 Elijah Newren 2006-03-30 19:05:50 UTC
Yeah, that paranoia probably makes sense.  I'll add an updated patch that does that.

It's probably worth noting that the tortoise-and-hare thing in meta_window_foreach_ancestor() only prevents certain kinds of infinite loops (you could have a longer cycle that goes undetected).  It also doesn't handle group-modal dialogs (not that my patch did either).  But all those extra complications are all part of bug 126489, so using the tortoise thing until it's fixed sounds like a good idea.  :)
Comment 8 Elijah Newren 2006-03-30 19:06:41 UTC
Created attachment 62412 [details] [review]
Fixed fix to 328211  ;-)
Comment 9 Elijah Newren 2006-03-30 19:27:03 UTC
I just looked at Björn's patch again, and now understand the flow to it.  I think the other patch is a little more clear, and it also handles some nastier cases (e.g. multiple top-level self-transient window part of the same app) -- though cases that we'll probably never actually see.

Björn: Thanks for the work; I think you still did the majority of the work by discovering the issue, listing a concrete testcase, and coming up with an initial patch.  :-)

2006-03-29  Elijah Newren  <newren gmail com>

	Fix grouping in the presence of ancestors; caught by Björn.
	#336184