summaryrefslogtreecommitdiff
path: root/src/layout/algorithm/tiled
diff options
context:
space:
mode:
authorVisal Vijay <150381094+B2krobbery@users.noreply.github.com>2026-04-16 22:23:12 +0530
committerGitHub <noreply@github.com>2026-04-16 17:53:12 +0100
commit1ea0a43615fa103b28f58648b36ffa2c95366753 (patch)
treeaa82e2a2b5fafe5d8c16df33175c19ad420b3aef /src/layout/algorithm/tiled
parented349e84d26f35a6ef20019f7315ddfd85d1e7ee (diff)
monocle: avoid repeated workspace monitor lock() calls (#14085)
* refactor(monocle): avoid repeated workspace monitor lock() calls * clang-format * cleanup: avoid repeated weak_ptr::lock() calls * style: shorten variable name PMONITORWORKSPACEOWNER to PMONITOR
Diffstat (limited to 'src/layout/algorithm/tiled')
-rw-r--r--src/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp b/src/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp
index fe92f27c..e1b4c608 100644
--- a/src/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp
+++ b/src/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp
@@ -211,10 +211,11 @@ void CMonocleAlgorithm::moveTargetInDirection(SP<ITarget> t, Math::eDirection di
if (!t || !t->space() || !t->space()->workspace())
return;
- const auto PMONINDIR = g_pCompositor->getMonitorInDirection(t->space()->workspace()->m_monitor.lock(), dir);
+ const auto PMONITOR = t->space()->workspace()->m_monitor.lock();
+ const auto PMONINDIR = g_pCompositor->getMonitorInDirection(PMONITOR, dir);
// if we found a monitor, move the window there
- if (PMONINDIR && PMONINDIR != t->space()->workspace()->m_monitor.lock()) {
+ if (PMONINDIR && PMONINDIR != PMONITOR) {
const auto TARGETWS = PMONINDIR->m_activeWorkspace;
if (t->window())