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:
parent
46e3da297c
commit
9e54cb5a1f
4 changed files with 9 additions and 8 deletions
7
main.cpp
7
main.cpp
|
@ -247,13 +247,6 @@ void Application::crashChecking()
|
||||||
QTimer::singleShot(15 * 1000, this, SLOT(resetCrashesCount()));
|
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)
|
void Application::crashHandler(int signal)
|
||||||
{
|
{
|
||||||
crashes++;
|
crashes++;
|
||||||
|
|
1
main.h
1
main.h
|
@ -205,7 +205,6 @@ protected:
|
||||||
}
|
}
|
||||||
void destroyAtoms();
|
void destroyAtoms();
|
||||||
|
|
||||||
bool notify(QObject* o, QEvent* e);
|
|
||||||
static void crashHandler(int signal);
|
static void crashHandler(int signal);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include <config-kwin.h>
|
#include <config-kwin.h>
|
||||||
// kwin
|
// kwin
|
||||||
#include "sm.h"
|
#include "sm.h"
|
||||||
|
#include "workspace.h"
|
||||||
#include "xcbutils.h"
|
#include "xcbutils.h"
|
||||||
|
|
||||||
// KDE
|
// KDE
|
||||||
|
@ -191,6 +192,13 @@ void ApplicationX11::performStartup()
|
||||||
createAtoms();
|
createAtoms();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ApplicationX11::notify(QObject* o, QEvent* e)
|
||||||
|
{
|
||||||
|
if (Workspace::self()->workspaceEvent(e))
|
||||||
|
return true;
|
||||||
|
return QApplication::notify(o, e);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
|
|
|
@ -50,6 +50,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void performStartup() override;
|
void performStartup() override;
|
||||||
|
bool notify(QObject *o, QEvent *e) override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void lostSelection();
|
void lostSelection();
|
||||||
|
|
Loading…
Reference in a new issue