From 42e924e7f61e7b36266e6c3ca07aa414e88f50ca Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 14 Mar 2016 18:41:50 +0000 Subject: [PATCH] Fix taskbar flicking when opening Plasma popups When we show a Qt window it resets all wm_states, including the SKIP_TASKBAR state that Qt doesn't support see QXcbWindow::setNetWmStates In order to set the flag we need to do it after Qt has mapped the window. This was previously done using ExposeEvent which will happen after show, but by it being a separate event the task manager will get notified in the meantime. By merging into the same event we can make sure the flag is set before the task manager processes it. BUG: 332024 REVIEW: 127374 --- src/plasmaquick/dialog.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp index 56f39c074..87a1757c8 100644 --- a/src/plasmaquick/dialog.cpp +++ b/src/plasmaquick/dialog.cpp @@ -1071,9 +1071,7 @@ void Dialog::showEvent(QShowEvent *event) bool Dialog::event(QEvent *event) { - if (event->type() == QEvent::Expose) { - KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager); - } else if (event->type() == QEvent::Show) { + if (event->type() == QEvent::Show) { d->updateVisibility(true); } else if (event->type() == QEvent::Hide) { d->updateVisibility(false); @@ -1171,7 +1169,18 @@ bool Dialog::event(QEvent *event) } } - return QQuickWindow::event(event); + bool rc = QQuickWindow::event(event); + + /* + * qxcbwindow resets WM_STATE to only the flags that Qt supports + * disacarding all other atoms just before it maps the window. We need to set additional flags afterwards. + * Can be moved to the constructor after https://codereview.qt-project.org/#/c/149013/ is merged. + */ + if (event->type() == QEvent::Show) { + KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager); + } + + return rc; } void Dialog::hideEvent(QHideEvent *event)