use sel to determine the right screen for current event instead of only XQueryPointer

This commit is contained in:
Julien Danjou 2007-09-24 14:20:04 +02:00
parent 917a82ed15
commit 1a276a7832
1 changed files with 11 additions and 6 deletions

View File

@ -342,8 +342,13 @@ handle_event_keypress(XEvent * e, awesome_config *awesomeconf)
keysym = XKeycodeToKeysym(e->xany.display, (KeyCode) ev->keycode, 0); keysym = XKeycodeToKeysym(e->xany.display, (KeyCode) ev->keycode, 0);
for(screen = 0; screen < ScreenCount(e->xany.display); screen++) /* find the right screen for this event */
if(XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen), &dummy, &dummy, &y, &x, &d, &d, &m)) 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++) for(i = 0; i < awesomeconf[screen].nkeys; i++)
if(keysym == awesomeconf[screen].keys[i].keysym if(keysym == awesomeconf[screen].keys[i].keysym
&& CLEANMASK(awesomeconf[screen].keys[i].mod, screen) == CLEANMASK(ev->state, screen) && awesomeconf[screen].keys[i].func) && CLEANMASK(awesomeconf[screen].keys[i].mod, screen) == CLEANMASK(ev->state, screen) && awesomeconf[screen].keys[i].func)