fix bug in Xinerama when mouse is not in the same screen that mouse
This commit is contained in:
parent
3e385c3bea
commit
845984fed0
27
event.c
27
event.c
|
@ -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,17 +351,20 @@ 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 */
|
||||||
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
if(sel)
|
||||||
if(XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen), &dummy, &dummy, &x, &y, &d, &d, &m))
|
screen = sel->screen;
|
||||||
{
|
else
|
||||||
/* if screen is 0, we are on first Zaphod screen or on the
|
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
||||||
* only screen in Xinerama, so we can ask for a better screen
|
if(XQueryPointer(e->xany.display, RootWindow(e->xany.display, screen), &dummy, &dummy, &x, &y, &d, &d, &m))
|
||||||
* 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 is 0, we are on first Zaphod screen or on the
|
||||||
if(screen == 0)
|
* only screen in Xinerama, so we can ask for a better screen
|
||||||
screen = get_screen_bycoord(e->xany.display, x, y);
|
* number with get_screen_bycoord: we'll get 0 in Zaphod mode
|
||||||
break;
|
* 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++)
|
for(i = 0; i < awesomeconf[screen].nkeys; i++)
|
||||||
if(keysym == awesomeconf[screen].keys[i].keysym
|
if(keysym == awesomeconf[screen].keys[i].keysym
|
||||||
|
|
Loading…
Reference in New Issue