diff --git a/geometry.cpp b/geometry.cpp --- a/geometry.cpp +++ b/geometry.cpp @@ -70,10 +70,12 @@ void Workspace::desktopResized() { QRect geom = screens()->geometry(); - NETSize desktop_geometry; - desktop_geometry.width = geom.width(); - desktop_geometry.height = geom.height(); - rootInfo()->setDesktopGeometry(desktop_geometry); + if (rootInfo()) { + NETSize desktop_geometry; + desktop_geometry.width = geom.width(); + desktop_geometry.height = geom.height(); + rootInfo()->setDesktopGeometry(desktop_geometry); + } updateClientArea(); saveOldScreenSizes(); // after updateClientArea(), so that one still uses the previous one @@ -309,13 +311,15 @@ oldrestrictedmovearea = restrictedmovearea; restrictedmovearea = new_rmoveareas; screenarea = new_sareas; - NETRect r; - for (int i = 1; i <= numberOfDesktops; i++) { - r.pos.x = workarea[ i ].x(); - r.pos.y = workarea[ i ].y(); - r.size.width = workarea[ i ].width(); - r.size.height = workarea[ i ].height(); - rootInfo()->setWorkArea(i, r); + if (rootInfo()) { + NETRect r; + for (int i = 1; i <= numberOfDesktops; i++) { + r.pos.x = workarea[ i ].x(); + r.pos.y = workarea[ i ].y(); + r.size.width = workarea[ i ].width(); + r.size.height = workarea[ i ].height(); + rootInfo()->setWorkArea(i, r); + } } for (auto it = m_allClients.constBegin(); diff --git a/layers.cpp b/layers.cpp --- a/layers.cpp +++ b/layers.cpp @@ -151,6 +151,9 @@ */ void Workspace::stackScreenEdgesUnderOverrideRedirect() { + if (!rootInfo()) { + return; + } Xcb::restackWindows(QVector() << rootInfo()->supportWindow() << ScreenEdges::self()->windows()); } @@ -160,6 +163,9 @@ */ void Workspace::propagateClients(bool propagate_new_clients) { + if (!rootInfo()) { + return; + } // restack the windows according to the stacking order // supportWindow > electric borders > clients > hidden clients QVector newWindowStack; diff --git a/workspace.cpp b/workspace.cpp --- a/workspace.cpp +++ b/workspace.cpp @@ -948,7 +948,9 @@ } } // Now propagate the change, after hiding, before showing - rootInfo()->setCurrentDesktop(VirtualDesktopManager::self()->current()); + if (rootInfo()) { + rootInfo()->setCurrentDesktop(VirtualDesktopManager::self()->current()); + } if (movingClient && !movingClient->isOnDesktop(newDesktop)) { movingClient->setDesktop(newDesktop); @@ -1246,7 +1248,9 @@ void Workspace::sendPingToWindow(xcb_window_t window, xcb_timestamp_t timestamp) { - rootInfo()->sendPing(window, timestamp); + if (rootInfo()) { + rootInfo()->sendPing(window, timestamp); + } } /**