summaryrefslogtreecommitdiff
path: root/src/managers/input/Swipe.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-25 15:42:27 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-25 15:42:27 +0200
commit14176f01ca5c584cc17db2dea3d0968c05d8cc01 (patch)
treeb814c614c697bae03b992bee37ad596a831ef647 /src/managers/input/Swipe.cpp
parent574d950145a332491dc391aaee5c505f9fd45747 (diff)
fix swiping with one workspace on monitor
Diffstat (limited to 'src/managers/input/Swipe.cpp')
-rw-r--r--src/managers/input/Swipe.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp
index e3c1b9ea..bde806d3 100644
--- a/src/managers/input/Swipe.cpp
+++ b/src/managers/input/Swipe.cpp
@@ -9,6 +9,16 @@ void CInputManager::onSwipeBegin(wlr_pointer_swipe_begin_event* e) {
if (e->fingers != *PSWIPEFINGERS|| *PSWIPE == 0)
return;
+ int onMonitor = 0;
+ for (auto& w : g_pCompositor->m_vWorkspaces) {
+ if (w->m_iMonitorID == g_pCompositor->m_pLastMonitor->ID) {
+ onMonitor++;
+ }
+ }
+
+ if (onMonitor < 2)
+ return; // disallow swiping when there's 1 workspace on a monitor
+
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace);
Debug::log(LOG, "Starting a swipe from %s", PWORKSPACE->m_szName.c_str());