From 5533e1946b4daff39123af615f7d223c99ea2024 Mon Sep 17 00:00:00 2001 From: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> Date: Tue, 29 Oct 2024 22:15:20 +0000 Subject: [PATCH] only add timer once modified: src/managers/KeybindManager.cpp --- src/managers/KeybindManager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index beefe386..09ea7e10 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -735,11 +735,13 @@ SDispatchResult CKeybindManager::handleKeybinds(const uint32_t modmask, const SP if (k.repeat) { m_pActiveKeybinds.push_back(&k); - m_pActiveKeybindEventSource = wl_event_loop_add_timer(g_pCompositor->m_sWLEventLoop, repeatKeyHandler, &m_pActiveKeybinds); + if (!m_pActiveKeybindEventSource) { + m_pActiveKeybindEventSource = wl_event_loop_add_timer(g_pCompositor->m_sWLEventLoop, repeatKeyHandler, &m_pActiveKeybinds); - const auto PACTIVEKEEB = g_pSeatManager->keyboard.lock(); + const auto PACTIVEKEEB = g_pSeatManager->keyboard.lock(); - wl_event_source_timer_update(m_pActiveKeybindEventSource, PACTIVEKEEB->repeatDelay); + wl_event_source_timer_update(m_pActiveKeybindEventSource, PACTIVEKEEB->repeatDelay); + } } if (!k.nonConsuming)