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.
This commit is contained in:
Martin Gräßlin 2016-02-17 09:26:38 +01:00
parent 46e3da297c
commit 9e54cb5a1f
4 changed files with 9 additions and 8 deletions

View file

@ -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++;

1
main.h
View file

@ -205,7 +205,6 @@ protected:
}
void destroyAtoms();
bool notify(QObject* o, QEvent* e);
static void crashHandler(int signal);
protected:

View file

@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <config-kwin.h>
// 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"

View file

@ -50,6 +50,7 @@ public:
protected:
void performStartup() override;
bool notify(QObject *o, QEvent *e) override;
private Q_SLOTS:
void lostSelection();