[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!
This commit is contained in:
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()) if (isDisplayed())
qCDebug(KWIN_TABBOX) << "Tab box was not properly closed by an effect"; qCDebug(KWIN_TABBOX) << "Tab box was not properly closed by an effect";
m_tabBox->hide(abort); m_tabBox->hide(abort);
Xcb::sync(); if (kwinApp()->x11Connection()) {
Xcb::sync();
}
} }
void TabBox::reconfigure() void TabBox::reconfigure()

View file

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