summaryrefslogtreecommitdiff
path: root/src/managers
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2023-11-12 13:34:42 +0000
committerVaxry <vaxry@vaxry.net>2023-11-12 13:34:54 +0000
commit69e314207d193eb67be0ae153d50c6c6bcee4b60 (patch)
tree062189da23659b0206ed3b6287652c09959d2b59 /src/managers
parent1bfd4a2bff5f67872b868d519fbb45b32aa72b1f (diff)
internal: replace INT_MAX with WORKSPACE_INVALID
Diffstat (limited to 'src/managers')
-rw-r--r--src/managers/KeybindManager.cpp12
-rw-r--r--src/managers/input/Swipe.cpp2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index e4cac5f4..d8307de2 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -831,7 +831,7 @@ void CKeybindManager::changeworkspace(std::string args) {
workspaceToChangeTo = getWorkspaceIDFromString(args, workspaceName);
}
- if (workspaceToChangeTo == INT_MAX) {
+ if (workspaceToChangeTo == WORKSPACE_INVALID) {
Debug::log(ERR, "Error in changeworkspace, invalid value");
return;
}
@@ -920,7 +920,7 @@ void CKeybindManager::moveActiveToWorkspace(std::string args) {
std::string workspaceName;
const auto WORKSPACEID = getWorkspaceIDFromString(args, workspaceName);
- if (WORKSPACEID == INT_MAX) {
+ if (WORKSPACEID == WORKSPACE_INVALID) {
Debug::log(LOG, "Invalid workspace in moveActiveToWorkspace");
return;
}
@@ -977,7 +977,7 @@ void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) {
const int WORKSPACEID = getWorkspaceIDFromString(args, workspaceName);
- if (WORKSPACEID == INT_MAX) {
+ if (WORKSPACEID == WORKSPACE_INVALID) {
Debug::log(ERR, "Error in moveActiveToWorkspaceSilent, invalid value");
return;
}
@@ -1233,7 +1233,7 @@ void CKeybindManager::alterSplitRatio(std::string args) {
}
}
- if (splitratio == INT_MAX) {
+ if (splitratio == WORKSPACE_INVALID) {
Debug::log(ERR, "Splitratio invalid in alterSplitRatio!");
return;
}
@@ -1425,7 +1425,7 @@ void CKeybindManager::moveWorkspaceToMonitor(std::string args) {
std::string workspaceName;
const int WORKSPACEID = getWorkspaceIDFromString(workspace, workspaceName);
- if (WORKSPACEID == INT_MAX) {
+ if (WORKSPACEID == WORKSPACE_INVALID) {
Debug::log(ERR, "moveWorkspaceToMonitor invalid workspace!");
return;
}
@@ -1447,7 +1447,7 @@ void CKeybindManager::toggleSpecialWorkspace(std::string args) {
std::string workspaceName = "";
int workspaceID = getWorkspaceIDFromString("special:" + args, workspaceName);
- if (workspaceID == INT_MAX || !g_pCompositor->isWorkspaceSpecial(workspaceID)) {
+ if (workspaceID == WORKSPACE_INVALID || !g_pCompositor->isWorkspaceSpecial(workspaceID)) {
Debug::log(ERR, "Invalid workspace passed to special");
return;
}
diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp
index 360397eb..dba3d735 100644
--- a/src/managers/input/Swipe.cpp
+++ b/src/managers/input/Swipe.cpp
@@ -211,7 +211,7 @@ void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
auto workspaceIDLeft = getWorkspaceIDFromString(*PSWIPENUMBER ? "-1" : (*PSWIPEUSER ? "r-1" : "m-1"), wsname);
auto workspaceIDRight = getWorkspaceIDFromString(*PSWIPENUMBER ? "+1" : (*PSWIPEUSER ? "r+1" : "m+1"), wsname);
- if ((workspaceIDLeft == INT_MAX || workspaceIDRight == INT_MAX || workspaceIDLeft == m_sActiveSwipe.pWorkspaceBegin->m_iID) && !*PSWIPENEW) {
+ if ((workspaceIDLeft == WORKSPACE_INVALID || workspaceIDRight == WORKSPACE_INVALID || workspaceIDLeft == m_sActiveSwipe.pWorkspaceBegin->m_iID) && !*PSWIPENEW) {
m_sActiveSwipe.pWorkspaceBegin = nullptr; // invalidate the swipe
return;
}