From 88e36d0b04cc136fa49ac5916cd2147dd00f7e81 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Fri, 11 Feb 2022 16:26:01 +0100 Subject: [PATCH] Fix build without Qt session manager Signed-off-by: Eike Hein --- src/workspace.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/workspace.cpp b/src/workspace.cpp index adc618c8e5..0275119f1e 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -339,7 +339,11 @@ void Workspace::initializeX11() // TODO: only in X11 mode // Extra NETRootInfo instance in Client mode is needed to get the values of the properties NETRootInfo client_info(kwinApp()->x11Connection(), NET::ActiveWindow | NET::CurrentDesktop); - if (!qApp->isSessionRestored()) { + bool sessionRestored = false; +#ifndef QT_NO_SESSIONMANAGER + sessionRestored = qApp->isSessionRestored(); +#endif + if (!sessionRestored) { m_initialDesktop = client_info.currentDesktop(); vds->setCurrent(m_initialDesktop); } @@ -348,7 +352,7 @@ void Workspace::initializeX11() rootInfo->setActiveWindow(XCB_WINDOW_NONE); focusToNull(); - if (!qApp->isSessionRestored()) + if (!sessionRestored) ++block_focus; // Because it will be set below { @@ -411,7 +415,7 @@ void Workspace::initializeX11() // TODO: only on X11? AbstractClient* new_active_client = nullptr; - if (!qApp->isSessionRestored()) { + if (!sessionRestored) { --block_focus; new_active_client = findClient(Predicate::WindowMatch, client_info.activeWindow()); }