From 1a276a7832a5fd7cf1234d0008edd300cc74eb5e Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 24 Sep 2007 14:20:04 +0200 Subject: [PATCH] use sel to determine the right screen for current event instead of only XQueryPointer --- event.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/event.c b/event.c index 4d986363..1a2d3766 100644 --- a/event.c +++ b/event.c @@ -342,12 +342,17 @@ handle_event_keypress(XEvent * e, awesome_config *awesomeconf) keysym = XKeycodeToKeysym(e->xany.display, (KeyCode) ev->keycode, 0); - for(screen = 0; screen < ScreenCount(e->xany.display); screen++) - if(XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen), &dummy, &dummy, &y, &x, &d, &d, &m)) - for(i = 0; i < awesomeconf[screen].nkeys; i++) - if(keysym == awesomeconf[screen].keys[i].keysym - && CLEANMASK(awesomeconf[screen].keys[i].mod, screen) == CLEANMASK(ev->state, screen) && awesomeconf[screen].keys[i].func) - awesomeconf[screen].keys[i].func(e->xany.display, &dc[screen], &awesomeconf[screen], awesomeconf[screen].keys[i].arg); + /* find the right screen for this event */ + if(sel) + screen = sel->screen; + else + for(screen = 0; screen < ScreenCount(e->xany.display) && + !XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen), &dummy, &dummy, &y, &x, &d, &d, &m); screen++); + + for(i = 0; i < awesomeconf[screen].nkeys; i++) + if(keysym == awesomeconf[screen].keys[i].keysym + && CLEANMASK(awesomeconf[screen].keys[i].mod, screen) == CLEANMASK(ev->state, screen) && awesomeconf[screen].keys[i].func) + awesomeconf[screen].keys[i].func(e->xany.display, &dc[screen], &awesomeconf[screen], awesomeconf[screen].keys[i].arg); } void