diff options
| author | Visal Vijay <150381094+B2krobbery@users.noreply.github.com> | 2026-04-10 19:08:28 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-10 14:38:28 +0100 |
| commit | f7755322fc515108cc9eed8113c09492d4a352c1 (patch) | |
| tree | 6289ed5352651e28d4885498534edf93b11cf8d9 /src/managers/input/InputManager.cpp | |
| parent | fb46d16fc2bedea96b6b2a4d005ec66d701431aa (diff) | |
input: avoid repeated weak_ptr::lock() and ensure consistent usage (#14039)
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 8672d28c..d1dafbc9 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -255,9 +255,12 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, st if (PMONITOR->m_cursorZoom->value() != 1.f) g_pHyprRenderer->damageMonitor(PMONITOR); - bool skipFrameSchedule = PMONITOR->shouldSkipScheduleFrameOnMouseEvent(); + bool skipFrameSchedule = PMONITOR->shouldSkipScheduleFrameOnMouseEvent(); - if (!PMONITOR->m_solitaryClient.lock() && g_pHyprRenderer->shouldRenderCursor() && g_pPointerManager->softwareLockedFor(PMONITOR->m_self.lock()) && !skipFrameSchedule) + const auto solitary = PMONITOR->m_solitaryClient.lock(); + const auto self = PMONITOR->m_self.lock(); + + if (!solitary && g_pHyprRenderer->shouldRenderCursor() && g_pPointerManager->softwareLockedFor(self) && !skipFrameSchedule) g_pCompositor->scheduleFrameForMonitor(PMONITOR, Aquamarine::IOutput::AQ_SCHEDULE_CURSOR_MOVE); // constraints @@ -513,7 +516,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, st if (!foundSurface) foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &PMONITOR->m_layerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], &surfaceCoords, &pFoundLayerSurface); - if (g_pPointerManager->softwareLockedFor(PMONITOR->m_self.lock()) > 0 && !skipFrameSchedule) + if (g_pPointerManager->softwareLockedFor(self) > 0 && !skipFrameSchedule) g_pCompositor->scheduleFrameForMonitor(Desktop::focusState()->monitor(), Aquamarine::IOutput::AQ_SCHEDULE_CURSOR_MOVE); // FIXME: This will be disabled during DnD operations because we do not exactly follow the spec |
