From e09956f244099ddd36b1a2cd5d7800d5fc7120c1 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Thu, 6 Dec 2007 05:30:43 -0500 Subject: =?UTF-8?q?Select=20correct=20client=20window=20in=20WM=E2=80=99s?= =?UTF-8?q?=20using=20virtual=20roots=20From=20bug=202185=C2=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When manually selecting a window, xprop finds the top-level window containing the pointer and uses XmuClientWindow to attempt to find a client window having WM_STATE set. In a WM using virtual roots (e.g. enlightenment, desks other than first) this fails beacuse the top-level window is a virtual root, and XmuClientWindow seems to find the first client having WM_STATE set, which only by coincidence will be the one the user intended to select (i.e. containing the pointer). The solution is to descend the window hierarchy at the pointer location to find a window with WM_STATE set. 1] https://bugs.freedesktop.org/show_bug.cgi?id=2185 Signed-off-by: James Cloos --- xprop.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'xprop.c') diff --git a/xprop.c b/xprop.c index c489486..f1bf02a 100644 --- a/xprop.c +++ b/xprop.c @@ -51,7 +51,6 @@ from The Open Group. #endif #include -#include #include "dsimple.h" @@ -1702,19 +1701,8 @@ main (int argc, char **argv) if ((remove_props != NULL || set_props != NULL) && argc > 0) usage(); - if (target_win == None) { - target_win = Select_Window(dpy); - if (target_win != None && !frame_only) { - Window root; - int dummyi; - unsigned int dummy; - - if (XGetGeometry (dpy, target_win, &root, &dummyi, &dummyi, - &dummy, &dummy, &dummy, &dummy) - && target_win != root) - target_win = XmuClientWindow (dpy, target_win); - } - } + if (target_win == None) + target_win = Select_Window(dpy, !frame_only); if (remove_props != NULL) { int count; -- cgit v1.2.3