In ClientWin.c, TryChildren() calls XQueryTree and returns the first window in the list with a WM_STATE property set. However, XQueryTree returns a list of children that "are listed in current stacking order, from bottom-most (first) to top-most (last)." Thus, when a window contains more than one client, XmuClientWindow returns the bottom-most one. This affects the behavior of tools like xprop in fluxbox and probably ion, pekwm, etc. I've tested the following patch, and it fixes the behavior: --- oldClientWin.c 2006-07-10 00:26:04.000000000 -0500 +++ ClientWin.c 2006-07-10 00:09:26.000000000 -0500 @@ -82,18 +82,18 @@ if (!XQueryTree(dpy, win, &root, &parent, &children, &nchildren)) return 0; - for (i = 0; !inf && (i < nchildren); i++) { + for (i = nchildren; !inf && i; i--) { data = NULL; - XGetWindowProperty(dpy, children[i], WM_STATE, 0, 0, False, + XGetWindowProperty(dpy, children[i-1], WM_STATE, 0, 0, False, AnyPropertyType, &type, &format, &nitems, &after, &data); if (data) XFree(data); if (type) - inf = children[i]; + inf = children[i-1]; } - for (i = 0; !inf && (i < nchildren); i++) - inf = TryChildren(dpy, children[i], WM_STATE); + for (i = nchildren; !inf && i; i--) + inf = TryChildren(dpy, children[i-1], WM_STATE); if (children) XFree(children); return inf;
Created attachment 6392 [details] [review] patch to libXmu-1.0.2/src/ClientWin.c It seems that somewhere between here and the file, the number of spaces on each line changes. Thus, the patch doesn't apply easily. I'm attaching a copy, in case you don't feel like figuring out why. I also accidentally came upon a page confirming that this causes problems for Ion, too.
Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future.
You say that it "affects the behavior of tools like xprop in fluxbox" ... how does it affect their behavior. Why does the ordering of the list matter? Other tools may expect the current ordering.
The window managers I listed implement tabbed windows: multiple client windows are children of the same parent window. `xprop' allows a user to click on a window and get a list of its window properties. However, under the current implementation, `xprop' returns the information for a client window other than the one being clicked on (specifically, the least recently used client in the parent window). While it's possible that other tools rely on the current order, I've been using this patch for five years and haven't noticed any side effects.
Would you mind sending it to xorg-devel for review?
Mass closure: This bug has been untouched for more than six years, and is not obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.