From 9e54cb5a1f7353b89194587323c9b387b463bc70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 17 Feb 2016 09:26:38 +0100 Subject: [PATCH] Move global event filter from Application to ApplicationX11 The event filter is only used to let Qt compose a QKeyEvent from an x11 event for grabbed key events. On Wayland we don't need it as we can generate good QKeyEvents ourself. This means less event processing as the events no longer need to pass through the Workspace::workspaceEvent. In addition it fixes a regression in LockScreenTest::testEffectsKeyboard caused by the LockScreenEventFilter sending a QKeyEvent to KSldApp. This event got intercepted by the global event filter making the test rightfully fail. --- main.cpp | 7 ------- main.h | 1 - main_x11.cpp | 8 ++++++++ main_x11.h | 1 + 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/main.cpp b/main.cpp index 9046e46d48..25f5fae984 100644 --- a/main.cpp +++ b/main.cpp @@ -247,13 +247,6 @@ void Application::crashChecking() QTimer::singleShot(15 * 1000, this, SLOT(resetCrashesCount())); } -bool Application::notify(QObject* o, QEvent* e) -{ - if (Workspace::self()->workspaceEvent(e)) - return true; - return QApplication::notify(o, e); -} - void Application::crashHandler(int signal) { crashes++; diff --git a/main.h b/main.h index 1822afce60..1ea9c1c1d8 100644 --- a/main.h +++ b/main.h @@ -205,7 +205,6 @@ protected: } void destroyAtoms(); - bool notify(QObject* o, QEvent* e); static void crashHandler(int signal); protected: diff --git a/main_x11.cpp b/main_x11.cpp index a0644bca3a..43d7477945 100644 --- a/main_x11.cpp +++ b/main_x11.cpp @@ -23,6 +23,7 @@ along with this program. If not, see . #include // kwin #include "sm.h" +#include "workspace.h" #include "xcbutils.h" // KDE @@ -191,6 +192,13 @@ void ApplicationX11::performStartup() createAtoms(); } +bool ApplicationX11::notify(QObject* o, QEvent* e) +{ + if (Workspace::self()->workspaceEvent(e)) + return true; + return QApplication::notify(o, e); +} + } // namespace extern "C" diff --git a/main_x11.h b/main_x11.h index ef3c44464f..ca25bf486a 100644 --- a/main_x11.h +++ b/main_x11.h @@ -50,6 +50,7 @@ public: protected: void performStartup() override; + bool notify(QObject *o, QEvent *e) override; private Q_SLOTS: void lostSelection();