summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2022-09-17 15:05:12 +0100
committervaxerski <vaxry@vaxry.net>2022-09-17 15:05:12 +0100
commita72a39ebd555c24751a0c4853a495de5ba4bed0d (patch)
tree0d2883604dc3d8f5fee36da5ba9206249195e779 /src
parent151e013241e29d0f4f2619db17257343503e20ea (diff)
minor swipe fixes
Diffstat (limited to 'src')
-rw-r--r--src/Compositor.cpp3
-rw-r--r--src/helpers/MiscFunctions.cpp3
-rw-r--r--src/managers/input/Swipe.cpp6
3 files changed, 10 insertions, 2 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 281b1de9..b8b76039 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -1591,6 +1591,9 @@ bool CCompositor::workspaceIDOutOfBounds(const int& id) {
int highestID = -99999;
for (auto& w : m_vWorkspaces) {
+ if (w->m_iID == SPECIAL_WORKSPACE_ID)
+ continue;
+
if (w->m_iID < lowestID)
lowestID = w->m_iID;
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp
index 405a53d8..2775e0b4 100644
--- a/src/helpers/MiscFunctions.cpp
+++ b/src/helpers/MiscFunctions.cpp
@@ -221,6 +221,9 @@ int getWorkspaceIDFromString(const std::string& in, std::string& outName) {
int highestID = -99999;
for (auto& w : g_pCompositor->m_vWorkspaces) {
+ if (w->m_iID == SPECIAL_WORKSPACE_ID)
+ continue;
+
if (w->m_iID < lowestID)
lowestID = w->m_iID;
diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp
index fe78145d..30303680 100644
--- a/src/managers/input/Swipe.cpp
+++ b/src/managers/input/Swipe.cpp
@@ -10,7 +10,7 @@ void CInputManager::onSwipeBegin(wlr_pointer_swipe_begin_event* e) {
int onMonitor = 0;
for (auto& w : g_pCompositor->m_vWorkspaces) {
- if (w->m_iMonitorID == g_pCompositor->m_pLastMonitor->ID) {
+ if (w->m_iMonitorID == g_pCompositor->m_pLastMonitor->ID && w->m_iID != SPECIAL_WORKSPACE_ID) {
onMonitor++;
}
}
@@ -125,8 +125,10 @@ void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
auto workspaceIDLeft = getWorkspaceIDFromString("m-1", wsname);
auto workspaceIDRight = getWorkspaceIDFromString("m+1", wsname);
- if (workspaceIDLeft == INT_MAX || workspaceIDRight == INT_MAX || workspaceIDLeft == m_sActiveSwipe.pWorkspaceBegin->m_iID)
+ if (workspaceIDLeft == INT_MAX || workspaceIDRight == INT_MAX || workspaceIDLeft == m_sActiveSwipe.pWorkspaceBegin->m_iID) {
+ m_sActiveSwipe.pWorkspaceBegin = nullptr; // invalidate the swipe
return;
+ }
m_sActiveSwipe.pWorkspaceBegin->m_bForceRendering = true;