Skip to content

Commit 0273b2e

Browse files
committed
workspace: fix emptym
Empty workspaces on other monitors should be ignored. Fixes #8416
1 parent 7ccc57e commit 0273b2e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/helpers/MiscFunctions.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,16 @@ SWorkspaceIDName getWorkspaceIDNameFromString(const std::string& in) {
164164
WORKSPACEID id = next ? Desktop::focusState()->monitor()->activeWorkspaceID() : 0;
165165
while (++id < LONG_MAX) {
166166
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(id);
167-
if (!invalidWSes.contains(id) && (!PWORKSPACE || PWORKSPACE->getWindows() == 0)) {
168-
result.id = id;
169-
return result;
167+
if (invalidWSes.contains(id))
168+
continue;
169+
if (PWORKSPACE) {
170+
if (PWORKSPACE->getWindows())
171+
continue;
172+
if (same_mon && PWORKSPACE->m_monitor && PWORKSPACE->m_monitor->m_id != g_pCompositor->m_lastMonitor->m_id)
173+
continue;
170174
}
175+
result.id = id;
176+
return result;
171177
}
172178
} else if (in.starts_with("prev")) {
173179
if (!Desktop::focusState()->monitor())

0 commit comments

Comments
 (0)