[tabbox] Guard Xcb::sync with whether we have an X11 connection

Otherwise crash on WaylandOnly once you Alt+Tab. Credits go to our
integration tests for finding this issue!
icc-effect-5.14.5
Martin Flöser 2017-09-30 16:29:42 +02:00
parent a74f8766c3
commit 3ce9a4a179
2 changed files with 6 additions and 2 deletions

View File

@ -777,7 +777,9 @@ void TabBox::hide(bool abort)
if (isDisplayed())
qCDebug(KWIN_TABBOX) << "Tab box was not properly closed by an effect";
m_tabBox->hide(abort);
Xcb::sync();
if (kwinApp()->x11Connection()) {
Xcb::sync();
}
}
void TabBox::reconfigure()

View File

@ -384,7 +384,9 @@ void TabBoxHandler::show()
d->show();
}
if (d->config.isHighlightWindows()) {
Xcb::sync();
if (kwinApp()->x11Connection()) {
Xcb::sync();
}
// TODO this should be
// QMetaObject::invokeMethod(this, "initHighlightWindows", Qt::QueuedConnection);
// but we somehow need to cross > 1 event cycle (likely because of queued invocation in the effects)