From 4c2eb55636fb4485deaebf67f01ae4d07d29ce6d Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 21 Jun 2017 14:01:47 +0200 Subject: [PATCH] create shell surface only at the right moment Summary: make the behavior similar to Dialog create a plasmashell surface only when isVisible() as some expose events can arrive there too, and also not create the shell surface if the exposed surface is null Test Plan: krunner seems to be more reliable Reviewers: #plasma, davidedmundson Reviewed By: #plasma, davidedmundson Subscribers: broulik, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D6299 --- krunner/view.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/krunner/view.cpp b/krunner/view.cpp index b30179c25..59c7dff39 100644 --- a/krunner/view.cpp +++ b/krunner/view.cpp @@ -230,7 +230,13 @@ bool View::event(QEvent *event) if (m_plasmaShell && event->type() == QEvent::Expose) { using namespace KWayland::Client; - if (!m_plasmaShellSurface) { + auto ee = static_cast(event); + + if (ee->region().isNull()) { + return retval; + } + + if (!m_plasmaShellSurface && isVisible()) { Surface *s = Surface::fromWindow(this); if (!s) { return retval;