summaryrefslogtreecommitdiff
path: root/src/helpers
diff options
context:
space:
mode:
authorVisal Vijay <150381094+B2krobbery@users.noreply.github.com>2026-04-04 18:06:58 +0530
committerGitHub <noreply@github.com>2026-04-04 13:36:58 +0100
commit49686f96c7b8167be71710694c29ef6a1b97adff (patch)
tree515001251b4b5c35d226b3d525cc965dc8fa6e2b /src/helpers
parenta3d262d148cc4de311d95242cfd2f4ed82f58b17 (diff)
miscfunctions: reuse monitor pointer instead of repeated calls (#13977)
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/MiscFunctions.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp
index 2a200f1e..71616ebf 100644
--- a/src/helpers/MiscFunctions.cpp
+++ b/src/helpers/MiscFunctions.cpp
@@ -173,10 +173,11 @@ SWorkspaceIDName getWorkspaceIDNameFromString(const std::string& in) {
}
}
} else if (in.starts_with("prev")) {
- if (!Desktop::focusState()->monitor())
+ auto monitor = Desktop::focusState()->monitor();
+ if (!monitor)
return {WORKSPACE_INVALID};
- const auto PWORKSPACE = Desktop::focusState()->monitor()->m_activeWorkspace;
+ const auto PWORKSPACE = monitor->m_activeWorkspace;
if (!valid(PWORKSPACE))
return {WORKSPACE_INVALID};