fix bug in Xinerama when mouse is not in the same screen that mouse

This commit is contained in:
Julien Danjou 2007-10-01 11:28:21 +02:00
parent 3e385c3bea
commit 845984fed0
1 changed files with 15 additions and 12 deletions

View File

@ -342,7 +342,7 @@ handle_event_expose(XEvent * e, awesome_config *awesomeconf)
void void
handle_event_keypress(XEvent * e, awesome_config *awesomeconf) handle_event_keypress(XEvent * e, awesome_config *awesomeconf)
{ {
int i, screen, x, y, d; int i, screen = 0, x, y, d;
unsigned int m; unsigned int m;
KeySym keysym; KeySym keysym;
XKeyEvent *ev = &e->xkey; XKeyEvent *ev = &e->xkey;
@ -351,6 +351,9 @@ 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);
/* find the right screen for this event */ /* find the right screen for this event */
if(sel)
screen = sel->screen;
else
for(screen = 0; screen < ScreenCount(e->xany.display); screen++) 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(XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen), &dummy, &dummy, &x, &y, &d, &d, &m))
{ {