diff --git a/event.c b/event.c index bc1d3885..eaa86d41 100644 --- a/event.c +++ b/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]); } }