Bug 2135

Summary: xprop doesnt select the right window in tab-using windowmanagers
Product: xorg Reporter: Mathias Gumz <akira>
Component: App/xpropAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED INVALID QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: high CC: roland.mainz
Version: unspecifiedKeywords: patch
Hardware: x86 (IA32)   
OS: Linux (All)   
URL: http://darkshed.net/files/c_cpp/akxprop
Whiteboard:
i915 platform: i915 features:

Description Mathias Gumz 2004-12-22 06:10:55 UTC
xprop selects only the first window, when clicking on a tab-group of them.
solution is to go the hierarchy up to the topmost window. i put it all together
in a little package called akxprop but that was just for convinience for some
people to test it.

for those who are unaware of what tabs are: http://fluxbox.org/features/tabs.php

the whole thing comes down to:

+- patch ------------

--- dsimple.c	2004-12-22 15:08:49.847042792 +0100
+++ dsimple.c.new	2004-12-22 15:07:11.517991080 +0100
@@ -531,6 +531,17 @@ Window Select_Window(dpy)
       if (target_win == None) {
 	target_win = event.xbutton.subwindow; /* window selected */
 	if (target_win == None) target_win = root;
+      } else { /* search topmost window (for tab-supporting wm's) */
+		Window root_return;
+		Window win_return;
+		Window parent_return;
+		Window *children_return = NULL;
+		unsigned int nr_children = 0;
+		if (XQueryTree(dpy, target_win, &root_return, &parent_return,
+			&children_return, &nr_children)) {
+			target_win = children_return[nr_children - 1];
+			XFree(children_return);
+        }
       }
       buttons++;
       break;

+- end of patch -------------
Comment 1 Kim Woelders 2005-01-01 03:03:36 UTC
I believe this is related to bug 2185.
However, the patch proposed here does not fix the problem for WM's using virtual
roots.
Maybe the solution suggested for bug 2185 also fixes this one?
Comment 2 Matt Turner 2010-12-03 13:25:54 UTC
This bug is old, and totally inactive. Closing.

If you'd like, please send the patch to xorg-devel@lists.x.org for review/inclusion.

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.