aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Kaijser <martijn@xbmc.org>2016-01-20 21:01:36 +0100
committerMartijn Kaijser <martijn@xbmc.org>2016-01-20 21:01:36 +0100
commit981b7dd0b9386bd2b0da464d6476b5a86250e8cb (patch)
tree4e4cc1bc9e9100375b466b1a405fead0948fe823
parenta2dd1ebaf3508a401e1831a4c57d449e00f4ba8e (diff)
parent54196042b7281702a9d28bbc8d5279974f6a760d (diff)
Merge pull request #8902 from koying/fixlongpress16.0rc1-Jarvis
FIX: [longpress] fixes ghost repeat
-rw-r--r--xbmc/input/InputManager.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/xbmc/input/InputManager.cpp b/xbmc/input/InputManager.cpp
index 1eaffc25da..3345a3d906 100644
--- a/xbmc/input/InputManager.cpp
+++ b/xbmc/input/InputManager.cpp
@@ -480,8 +480,13 @@ bool CInputManager::OnEvent(XBMC_Event& newEvent)
case XBMC_KEYUP:
m_Keyboard.ProcessKeyUp();
if (m_LastKey.GetButtonCode() != KEY_INVALID && !(m_LastKey.GetButtonCode() & CKey::MODIFIER_LONG))
- OnKey(m_LastKey);
- m_LastKey.Reset();
+ {
+ CKey key = m_LastKey;
+ m_LastKey.Reset(); // OnKey is reentrant; need to do this before entering
+ OnKey(key);
+ }
+ else
+ m_LastKey.Reset();
break;
case XBMC_MOUSEBUTTONDOWN:
case XBMC_MOUSEBUTTONUP: