From 491b5611c265f8a76db8964751dbdea345dad655 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 27 Sep 2007 17:53:01 +0200 Subject: [PATCH] Fix screen detection in keypress for supporting Xinerama --- event.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/event.c b/event.c index c52a1d105..e9bbd7539 100644 --- a/event.c +++ b/event.c @@ -343,20 +343,17 @@ handle_event_keypress(XEvent * e, awesome_config *awesomeconf) keysym = XKeycodeToKeysym(e->xany.display, (KeyCode) ev->keycode, 0); /* find the right screen for this event */ - if(sel) - screen = sel->screen; - else - for(screen = 0; screen < ScreenCount(e->xany.display); screen++) - if(XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen), &dummy, &dummy, &x, &y, &d, &d, &m)) - { - /* if screen is 0, we are on first Zaphod screen or on the - * only screen in Xinerama, so we can ask for a better screen - * number with get_screen_bycoord: we'll get 0 in Zaphod mode - * so it's the same, or maybe the real Xinerama screen */ - if(screen == 0) - screen = get_screen_bycoord(e->xany.display, x, y); - break; - } + for(screen = 0; screen < ScreenCount(e->xany.display); screen++) + if(XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen), &dummy, &dummy, &x, &y, &d, &d, &m)) + { + /* if screen is 0, we are on first Zaphod screen or on the + * only screen in Xinerama, so we can ask for a better screen + * number with get_screen_bycoord: we'll get 0 in Zaphod mode + * so it's the same, or maybe the real Xinerama screen */ + if(screen == 0) + screen = get_screen_bycoord(e->xany.display, x, y); + break; + } for(i = 0; i < awesomeconf[screen].nkeys; i++) if(keysym == awesomeconf[screen].keys[i].keysym