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.
This commit is contained in:
Nikos Ntarmos 2007-11-08 11:38:18 +01:00 committed by Julien Danjou
parent 96350151b9
commit ae406f51dc

View file

@ -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);