Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 8794fe54 authored by Martin Flöser's avatar Martin Flöser

Guard every remaining access to rootInfo

Summary:
For a future XFree KWin. Only remaining not guarded usages are in
Workspace::init, but that one needs to be refactored anyway for
becoming X free.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7173
parent ddf3536f
......@@ -70,10 +70,12 @@ extern bool is_multihead;
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 @@ void Workspace::updateClientArea(bool force)
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();
......
......@@ -151,6 +151,9 @@ void Workspace::updateStackingOrder(bool propagate_new_clients)
*/
void Workspace::stackScreenEdgesUnderOverrideRedirect()
{
if (!rootInfo()) {
return;
}
Xcb::restackWindows(QVector<xcb_window_t>() << rootInfo()->supportWindow() << ScreenEdges::self()->windows());
}
......@@ -160,6 +163,9 @@ void Workspace::stackScreenEdgesUnderOverrideRedirect()
*/
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<xcb_window_t> newWindowStack;
......
......@@ -948,7 +948,9 @@ void Workspace::updateClientVisibilityOnDesktopChange(uint oldDesktop, uint newD
}
}
// 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::sendClientToScreen(AbstractClient* c, int screen)
void Workspace::sendPingToWindow(xcb_window_t window, xcb_timestamp_t timestamp)
{
rootInfo()->sendPing(window, timestamp);
if (rootInfo()) {
rootInfo()->sendPing(window, timestamp);
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment