From 067b15bf7ce101c050f6240f38f5ee687e192a82 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 12 Oct 2007 10:49:03 +0200 Subject: [PATCH] new windows will be assigned to the current screen --- event.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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]); } }