From 7eb705472fb4ca476d605589f02bc5bc0304d15d Mon Sep 17 00:00:00 2001 From: dan Date: Sun, 30 Dec 2001 01:50:46 +0000 Subject: [PATCH] - Really fixed problem with keyboard shortcuts executed an every screen for multihead systems. - Fixed a wrong test in the selection code. --- WINGs/selection.c | 2 +- src/rootmenu.c | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 15 deletions(-) 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; }