diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-08-28 22:45:05 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-08-28 22:45:05 +0200 |
| commit | 09495375b52de47ddd97a46be1159721d207c862 (patch) | |
| tree | 1028f78dcf35dc797955812f4cff6462d6c9eda8 /src/managers/input/InputManager.cpp | |
| parent | 3c20ecb04d043013b559ec50fba4f816f05f0025 (diff) | |
ratelimit setting cursor
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 81e16550..27249eaa 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -209,11 +209,18 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { if (!foundSurface) foundSurface = g_pCompositor->vectorToLayerSurface(mouseCoords, &PMONITOR->m_aLayerSurfaceLists[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], &surfaceCoords, &pFoundLayerSurface); + g_pCompositor->scheduleFrameForMonitor(g_pCompositor->m_pLastMonitor); + if (!foundSurface) { - if (m_ecbClickBehavior == CLICKMODE_KILL) - wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "crosshair", g_pCompositor->m_sWLRCursor); - else - wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "left_ptr", g_pCompositor->m_sWLRCursor); + if (!m_bEmptyFocusCursorSet) { + // TODO: maybe wrap? + if (m_ecbClickBehavior == CLICKMODE_KILL) + wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "crosshair", g_pCompositor->m_sWLRCursor); + else + wlr_xcursor_manager_set_cursor_image(g_pCompositor->m_sWLRXCursorMgr, "left_ptr", g_pCompositor->m_sWLRCursor); + + m_bEmptyFocusCursorSet = true; + } wlr_seat_pointer_clear_focus(g_pCompositor->m_sSeat.seat); @@ -224,6 +231,8 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { return; } + m_bEmptyFocusCursorSet = false; + if (time) wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat); |
