From ae406f51dc4823f3ddb11c4bdb91e910e7054abe Mon Sep 17 00:00:00 2001 From: Nikos Ntarmos Date: Thu, 8 Nov 2007 11:38:18 +0100 Subject: [PATCH] Map new clients on the screen where the mouse pointer is I was having this annoying issue with multi-head setups on d9b49f5, where new clients would always get mapped to the same screen (leftmost). It seems that the x and y coordinate in the XWindowAttributes of new clients are set to 0,0. The attached patch ignores these values and uses the coordinates of the mouse pointer instead. --- event.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/event.c b/event.c index 7abb4af9c..f7a07db04 100644 --- a/event.c +++ b/event.c @@ -452,9 +452,7 @@ handle_event_maprequest(XEvent * e, awesome_config *awesomeconf) for(screen = 0; wa.screen != ScreenOfDisplay(e->xany.display, screen); screen++); if(screen == 0) { - screen = get_screen_bycoord(e->xany.display, wa.x, wa.y); - if(screen == 0 && - XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen), + if(XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen), &dummy, &dummy, &x, &y, &d, &d, &m)) screen = get_screen_bycoord(e->xany.display, x, y);