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 --- dsimple.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'dsimple.c') diff --git a/dsimple.c b/dsimple.c index 0c9fce8..2642e31 100644 --- a/dsimple.c +++ b/dsimple.c @@ -41,6 +41,7 @@ from The Open Group. * Written by Mark Lillibridge. Last updated 7/1/87 */ +#include "clientwin.h" #include "dsimple.h" /* @@ -263,7 +264,7 @@ Window Select_Window_Args( * Routine to let user select a window using the mouse */ -Window Select_Window(Display *dpy) +Window Select_Window(Display *dpy, int descend) { int status; Cursor cursor; @@ -302,6 +303,11 @@ Window Select_Window(Display *dpy) XUngrabPointer(dpy, CurrentTime); /* Done with pointer */ + if (!descend || (target_win == root)) + return(target_win); + + target_win = Find_Client(dpy, root, target_win); + return(target_win); } -- cgit v1.2.3