From 0c876cd93f1cdc2475e94e4b48f20c69c084b0ed Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 25 Sep 2019 14:27:15 +0100 Subject: [PATCH] Avoid event processing infinite loop Summary: Kwin on X11 overrides QCoreApplication::notify to get low level system event. If something handled by the low level filtering ever calls postEvent we would end up in a loop. This was found when forwarding a key event into a QQuickWindow in a similar manner that mouse events are forwarded. Fortunately there's a flag to separate generated and core events Test Plan: No more infinite loop Kwin X11 still works fine Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D24207 --- main_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main_x11.cpp b/main_x11.cpp index a58bd33000..67dc066697 100644 --- a/main_x11.cpp +++ b/main_x11.cpp @@ -273,7 +273,7 @@ void ApplicationX11::performStartup() bool ApplicationX11::notify(QObject* o, QEvent* e) { - if (Workspace::self()->workspaceEvent(e)) + if (e->spontaneous() && Workspace::self()->workspaceEvent(e)) return true; return QApplication::notify(o, e); }