From ec9a72d9fbe8372c4cc4e86966f6b13d178b0bba Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Tue, 23 Sep 2025 21:08:30 +0200 Subject: [PATCH] workspaces: fix persistence with no monitor specified (#11807) --- hyprtester/src/tests/main/workspaces.cpp | 10 ++++++++++ src/Compositor.cpp | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/hyprtester/src/tests/main/workspaces.cpp b/hyprtester/src/tests/main/workspaces.cpp index fa29338c8..de724af61 100644 --- a/hyprtester/src/tests/main/workspaces.cpp +++ b/hyprtester/src/tests/main/workspaces.cpp @@ -27,6 +27,16 @@ static bool test() { NLog::log("{}Switching to workspace 1", Colors::YELLOW); OK(getFromSocket("/dispatch workspace 1")); + NLog::log("{}Checking persistent no-mon", Colors::YELLOW); + OK(getFromSocket("r/keyword workspace 966,persistent:1")); + + { + auto str = getFromSocket("/workspaces"); + EXPECT_CONTAINS(str, "workspace ID 966 (966)"); + } + + OK(getFromSocket("/reload")); + NLog::log("{}Spawning kittyProc on ws 1", Colors::YELLOW); auto kittyProcA = Tests::spawnKitty(); diff --git a/src/Compositor.cpp b/src/Compositor.cpp index ce549459c..5ea88b115 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -3145,7 +3145,7 @@ void CCompositor::ensurePersistentWorkspacesPresent(const std::vectorm_id : m_lastMonitor->m_id, wsname, false); + PWORKSPACE = createNewWorkspace(id, PMONITOR->m_id, wsname, false); } if (!PMONITOR) {