diff --git a/src/layers.cpp b/src/layers.cpp index 60a52ad682..42d8ed498c 100644 --- a/src/layers.cpp +++ b/src/layers.cpp @@ -680,6 +680,9 @@ void Workspace::updateXStackingOrder() { // we use our stacking order for managed windows, but X's for override-redirect windows Xcb::Tree tree(kwinApp()->x11RootWindow()); + if (tree.isNull()) { + return; + } xcb_window_t *windows = tree.children(); const auto count = tree.data()->children_len;