new windows will be assigned to the current screen
This commit is contained in:
parent
863714f501
commit
067b15bf7c
11
event.c
11
event.c
|
@ -436,7 +436,9 @@ handle_event_maprequest(XEvent * e, awesome_config *awesomeconf)
|
|||
{
|
||||
static XWindowAttributes wa;
|
||||
XMapRequestEvent *ev = &e->xmaprequest;
|
||||
int screen;
|
||||
int screen, x, y, d;
|
||||
unsigned int m;
|
||||
Window dummy;
|
||||
|
||||
if(!XGetWindowAttributes(e->xany.display, ev->window, &wa))
|
||||
return;
|
||||
|
@ -446,7 +448,14 @@ 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),
|
||||
&dummy, &dummy, &x, &y, &d, &d, &m))
|
||||
screen = get_screen_bycoord(e->xany.display, x, y);
|
||||
|
||||
}
|
||||
manage(e->xany.display, ev->window, &wa, &awesomeconf[screen]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue