From 7ed07e45c7f406812ecf5c3df54504fbd0fd3bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 30 Aug 2013 13:34:29 +0200 Subject: [PATCH] Do not pass events with no window to the findClient - windowEvent cascade If the eventWindow is none the check for InputIdMatchPredicate will find a matching Client and pass the even through the windowEvent filter which returns true for all not handled events and thus filters out all events processed later on in KWin. This explains why some events were eaten... --- events.cpp | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/events.cpp b/events.cpp index 15fe94a642..92122ede40 100644 --- a/events.cpp +++ b/events.cpp @@ -229,27 +229,29 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e) }; const xcb_window_t eventWindow = findEventWindow(e); - if (Client* c = findClient(WindowMatchPredicate(eventWindow))) { - if (c->windowEvent(e)) - return true; - } else if (Client* c = findClient(WrapperIdMatchPredicate(eventWindow))) { - if (c->windowEvent(e)) - return true; - } else if (Client* c = findClient(FrameIdMatchPredicate(eventWindow))) { - if (c->windowEvent(e)) - return true; - } else if (Client *c = findClient(InputIdMatchPredicate(eventWindow))) { - if (c->windowEvent(e)) - return true; - } else if (Unmanaged* c = findUnmanaged(WindowMatchPredicate(eventWindow))) { - if (c->windowEvent(e)) - return true; - } else { - // We want to pass root window property events to effects - if (eventType == XCB_PROPERTY_NOTIFY) { - auto *event = reinterpret_cast(e); - if (event->window == rootWindow()) { - emit propertyNotify(event->atom); + if (eventWindow != XCB_WINDOW_NONE) { + if (Client* c = findClient(WindowMatchPredicate(eventWindow))) { + if (c->windowEvent(e)) + return true; + } else if (Client* c = findClient(WrapperIdMatchPredicate(eventWindow))) { + if (c->windowEvent(e)) + return true; + } else if (Client* c = findClient(FrameIdMatchPredicate(eventWindow))) { + if (c->windowEvent(e)) + return true; + } else if (Client *c = findClient(InputIdMatchPredicate(eventWindow))) { + if (c->windowEvent(e)) + return true; + } else if (Unmanaged* c = findUnmanaged(WindowMatchPredicate(eventWindow))) { + if (c->windowEvent(e)) + return true; + } else { + // We want to pass root window property events to effects + if (eventType == XCB_PROPERTY_NOTIFY) { + auto *event = reinterpret_cast(e); + if (event->window == rootWindow()) { + emit propertyNotify(event->atom); + } } } }