From 3ce9a4a179a5f74d3bda191b7c7b7905225715a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Sat, 30 Sep 2017 16:29:42 +0200 Subject: [PATCH] [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! --- tabbox/tabbox.cpp | 4 +++- tabbox/tabboxhandler.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tabbox/tabbox.cpp b/tabbox/tabbox.cpp index c5d53dce92..f397d791f4 100644 --- a/tabbox/tabbox.cpp +++ b/tabbox/tabbox.cpp @@ -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() diff --git a/tabbox/tabboxhandler.cpp b/tabbox/tabboxhandler.cpp index 9edfca2e54..9d8f16ce78 100644 --- a/tabbox/tabboxhandler.cpp +++ b/tabbox/tabboxhandler.cpp @@ -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)