diff options
author | UjinT34 <[email protected]> | 2024-06-14 14:45:32 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2024-06-14 13:45:32 +0200 |
commit | a9d53a2252f7ec084e2487d18777e2df01c8c351 (patch) | |
tree | d9c57d21becd4fe0c5e4e9619612289b479e4b2a /src/managers/input/InputManager.cpp | |
parent | b2590b58c51094424a9651d8df37dfab838b5bbb (diff) | |
download | Hyprland-a9d53a2252f7ec084e2487d18777e2df01c8c351.tar.gz Hyprland-a9d53a2252f7ec084e2487d18777e2df01c8c351.zip |
vrr: add option to fix mouse breaking vrr (#6483)
* option to fix mouse breaking vrr
* skip damage on mouse move
* remove this-> & cleanup
* add cursor:min_refresh_rate to avoid cursor freezing
* run clang-format
---------
Co-authored-by: UjinT34 <[email protected]>
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r-- | src/managers/input/InputManager.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 3aa8d2ae..81a46f97 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -187,7 +187,9 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { if (*PZOOMFACTOR != 1.f) g_pHyprRenderer->damageMonitor(PMONITOR); - if (!PMONITOR->solitaryClient.lock() && g_pHyprRenderer->shouldRenderCursor() && PMONITOR->output->software_cursor_locks > 0) + bool skipFrameSchedule = PMONITOR->shouldSkipScheduleFrameOnMouseEvent(); + + if (!PMONITOR->solitaryClient.lock() && g_pHyprRenderer->shouldRenderCursor() && PMONITOR->output->software_cursor_locks > 0 && !skipFrameSchedule) g_pCompositor->scheduleFrameForMonitor(PMONITOR); PHLWINDOW forcedFocus = m_pForcedFocus.lock(); @@ -370,7 +372,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &PMONITOR->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], &surfaceCoords, &pFoundLayerSurface); - if (g_pCompositor->m_pLastMonitor->output->software_cursor_locks > 0) + if (g_pCompositor->m_pLastMonitor->output->software_cursor_locks > 0 && !skipFrameSchedule) g_pCompositor->scheduleFrameForMonitor(g_pCompositor->m_pLastMonitor.get()); // grabs |