summaryrefslogtreecommitdiff
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index f11a2a4d..01566985 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -1021,4 +1021,19 @@ void CCompositor::moveWorkspaceToMonitor(CWorkspace* pWorkspace, SMonitor* pMoni
g_pLayoutManager->getCurrentLayout()->recalculateMonitor(POLDMON->ID);
g_pInputManager->refocus();
+}
+
+bool CCompositor::workspaceIDOutOfBounds(const int& id) {
+ int lowestID = 99999;
+ int highestID = -99999;
+
+ for (auto& w : m_lWorkspaces) {
+ if (w.m_iID < lowestID)
+ lowestID = w.m_iID;
+
+ if (w.m_iID > highestID)
+ highestID = w.m_iID;
+ }
+
+ return std::clamp(id, lowestID, highestID) != id;
} \ No newline at end of file