mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-15 04:25:58 +01:00
only add timer once
modified: src/managers/KeybindManager.cpp
This commit is contained in:
parent
bbf17b515a
commit
5533e1946b
1 changed files with 5 additions and 3 deletions
|
@ -735,12 +735,14 @@ SDispatchResult CKeybindManager::handleKeybinds(const uint32_t modmask, const SP
|
||||||
|
|
||||||
if (k.repeat) {
|
if (k.repeat) {
|
||||||
m_pActiveKeybinds.push_back(&k);
|
m_pActiveKeybinds.push_back(&k);
|
||||||
|
if (!m_pActiveKeybindEventSource) {
|
||||||
m_pActiveKeybindEventSource = wl_event_loop_add_timer(g_pCompositor->m_sWLEventLoop, repeatKeyHandler, &m_pActiveKeybinds);
|
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)
|
if (!k.nonConsuming)
|
||||||
found = true;
|
found = true;
|
||||||
|
|
Loading…
Reference in a new issue