summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVisal Vijay <150381094+B2krobbery@users.noreply.github.com>2026-04-12 22:27:06 +0530
committerGitHub <noreply@github.com>2026-04-12 17:57:06 +0100
commit24b121c7a3df5d4d5d44f19d6e4129ea82fdfc1e (patch)
tree5032248bb216c503791e11c0d8b47d83119e7bc2 /src
parentfe369dd9fb4d0d5517a1f19c0ff780d9a65b0c57 (diff)
cleanup: avoid repeated weak_ptr lock() calls in conditions (#14057)
Diffstat (limited to 'src')
-rw-r--r--src/desktop/view/LayerSurface.cpp2
-rw-r--r--src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/desktop/view/LayerSurface.cpp b/src/desktop/view/LayerSurface.cpp
index a69dd8e9..ec7c61f2 100644
--- a/src/desktop/view/LayerSurface.cpp
+++ b/src/desktop/view/LayerSurface.cpp
@@ -388,7 +388,7 @@ void CLayerSurface::onCommit() {
if (!WASEXCLUSIVE && ISEXCLUSIVE)
g_pInputManager->m_exclusiveLSes.push_back(m_self);
else if (WASEXCLUSIVE && !ISEXCLUSIVE)
- std::erase_if(g_pInputManager->m_exclusiveLSes, [this](const auto& other) { return !other.lock() || other.lock() == m_self.lock(); });
+ std::erase_if(g_pInputManager->m_exclusiveLSes, [this](const auto& other) { return !other || other == m_self; });
// if the surface was focused and interactive but now isn't, refocus
if (WASLASTFOCUS && m_layerSurface->m_current.interactivity == ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE) {
diff --git a/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp b/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp
index 642f5095..baf767be 100644
--- a/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp
+++ b/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp
@@ -129,7 +129,8 @@ void CDwindleAlgorithm::addTarget(SP<ITarget> target) {
// last fail-safe to avoid duplicate fullscreens
if ((!OPENINGON || OPENINGON->pTarget.lock() == target) && getNodes() > 1) {
for (auto& node : m_dwindleNodesData) {
- if (node->pTarget.lock() && node->pTarget.lock() != target) {
+ auto locked = node->pTarget.lock();
+ if (locked && locked != target) {
OPENINGON = node;
break;
}