diff --git a/WINGs/selection.c b/WINGs/selection.c index 660e513c..1f52a770 100644 --- a/WINGs/selection.c +++ b/WINGs/selection.c @@ -313,7 +313,7 @@ handleNotifyEvent(XEvent *event) WM_ITERATE_ARRAY(selCallbacks, handler, iter) { if (W_VIEW_DRAWABLE(handler->view) != event->xselection.requestor - && handler->selection == event->xselection.selection) { + || handler->selection != event->xselection.selection) { continue; } handler->flags.done_pending = 1; diff --git a/src/rootmenu.c b/src/rootmenu.c index a838c361..3eaad07a 100644 --- a/src/rootmenu.c +++ b/src/rootmenu.c @@ -416,31 +416,26 @@ raiseMenus(WMenu *menu) Bool wRootMenuPerformShortcut(XEvent *event) { + WScreen *scr = wScreenForRootWindow(event->xkey.root); Shortcut *ptr; int modifiers; int done = 0; Window dummy; int foo; - if (wScreenCount>1 && - XQueryPointer(dpy, event->xkey.root, &dummy, &dummy, &foo, &foo, &foo, - &foo, &foo)==False) { - /* Pointer is not on this screen. */ - return True; - } - /* ignore CapsLock */ modifiers = event->xkey.state & ValidModMask; for (ptr = shortcutList; ptr!=NULL; ptr = ptr->next) { - if (ptr->keycode==0) - continue; - - if (ptr->keycode==event->xkey.keycode && (ptr->modifier==modifiers)) { - (*ptr->entry->callback)(ptr->menu, ptr->entry); - done = True; - } + if (ptr->keycode==0 || ptr->menu->menu->screen_ptr!=scr) + continue; + + if (ptr->keycode==event->xkey.keycode && ptr->modifier==modifiers) { + (*ptr->entry->callback)(ptr->menu, ptr->entry); + done = True; + } } + return done; }