diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-05-31 12:33:08 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-05-31 12:33:08 +0200 |
| commit | df722cbb86bdc3b45827234c34e6ab90d02d5068 (patch) | |
| tree | 8b12be8a0ca40f62a5530e0dce7e6d709e44a6bc /src/Compositor.cpp | |
| parent | 68f7e565e628a1a52b4bc043e102c7bab7e6dd9a (diff) | |
Added relative monitor workspace offset
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 15 |
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 |
