From 1ea0a43615fa103b28f58648b36ffa2c95366753 Mon Sep 17 00:00:00 2001 From: Visal Vijay <150381094+B2krobbery@users.noreply.github.com> Date: Thu, 16 Apr 2026 22:23:12 +0530 Subject: 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 --- src/layout/algorithm/tiled/monocle/MonocleAlgorithm.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/layout/algorithm/tiled') 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 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()) -- cgit v1.2.3