diff --git a/main_wayland.cpp b/main_wayland.cpp index e7b2b43c85..664ffe7149 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -251,6 +251,19 @@ void ApplicationWayland::createX11Connection() setX11RootWindow(defaultScreen()->root); } +bool ApplicationWayland::notify(QObject *o, QEvent *e) +{ + if (qobject_cast< QWindow* >(o)) { + if (e->type() == QEvent::Expose) { + // ensure all Wayland events both on client and server side are dispatched + // otherwise it is possible that Qt starts rendering and blocks the main gui thread + // as it waits for the callback of the last frame + waylandServer()->dispatch(); + } + } + return Application::notify(o, e); +} + /** * Starts the Xwayland-Server. * The new process is started by forking into it. diff --git a/main_wayland.h b/main_wayland.h index 4f52e55b79..dc5257239f 100644 --- a/main_wayland.h +++ b/main_wayland.h @@ -39,6 +39,8 @@ public: m_applicationsToStart = applications; } + bool notify(QObject *o, QEvent *e) override; + protected: void performStartup() override;