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
This commit is contained in:
David Edmundson 2016-03-14 18:41:50 +00:00
parent f4e8df5fe8
commit 42e924e7f6

View File

@ -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)