only add timer once

modified:   src/managers/KeybindManager.cpp
This commit is contained in:
MightyPlaza 2024-10-29 22:15:20 +00:00
parent bbf17b515a
commit 5533e1946b
No known key found for this signature in database
GPG key ID: 284C27FD27A6DC0D

View file

@ -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)