mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-07 13:58:00 +02:00
miscfunctions: reuse monitor pointer instead of repeated calls (#13977)
This commit is contained in:
parent
a3d262d148
commit
49686f96c7
1 changed files with 3 additions and 2 deletions
|
|
@ -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};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue