new windows will be assigned to the current screen

This commit is contained in:
Julien Danjou 2007-10-12 10:49:03 +02:00
parent 863714f501
commit 067b15bf7c
1 changed files with 10 additions and 1 deletions

11
event.c
View File

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