Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2485 from koying/fixtouchactions

FIX: Send Touch actions to the proper window
  • Loading branch information...
commit 4ee5de266e393f1cfddc0f6ce6f705b0d2d10943 2 parents 7008e35 + b891c24
@koying koying authored
View
7 xbmc/Application.cpp
@@ -534,12 +534,15 @@ bool CApplication::OnEvent(XBMC_Event& newEvent)
int windowId = g_windowManager.GetActiveWindow() & WINDOW_ID_MASK;
int actionId = 0;
if (newEvent.touch.action == ACTION_GESTURE_BEGIN || newEvent.touch.action == ACTION_GESTURE_END)
+ {
actionId = newEvent.touch.action;
- else if (!CButtonTranslator::GetInstance().TranslateTouchAction(windowId, newEvent.touch.action, newEvent.touch.pointers, actionId) ||
+ windowId = WINDOW_INVALID;
+ }
+ else if (!CButtonTranslator::GetInstance().TranslateTouchAction(newEvent.touch.action, newEvent.touch.pointers, windowId, actionId) ||
actionId <= 0)
return false;
- CApplicationMessenger::Get().SendAction(CAction(actionId, 0, newEvent.touch.x, newEvent.touch.y, newEvent.touch.x2, newEvent.touch.y2), WINDOW_INVALID, false);
+ CApplicationMessenger::Get().SendAction(CAction(actionId, 0, newEvent.touch.x, newEvent.touch.y, newEvent.touch.x2, newEvent.touch.y2), windowId, false);
break;
}
}
View
5 xbmc/input/ButtonTranslator.cpp
@@ -870,7 +870,7 @@ bool CButtonTranslator::TranslateJoystickString(int window, const char* szDevice
return (action > 0);
}
-bool CButtonTranslator::TranslateTouchAction(int window, int touchAction, int touchPointers, int &action)
+bool CButtonTranslator::TranslateTouchAction(int touchAction, int touchPointers, int &window, int &action)
{
action = 0;
if (touchPointers <= 0)
@@ -881,7 +881,10 @@ bool CButtonTranslator::TranslateTouchAction(int window, int touchAction, int to
action = GetTouchActionCode(window, touchAction);
if (action <= 0)
+ {
+ window = WINDOW_INVALID;
action = GetTouchActionCode(-1, touchAction);
+ }
return action > 0;
}
View
2  xbmc/input/ButtonTranslator.h
@@ -97,7 +97,7 @@ class CButtonTranslator
bool &fullrange);
#endif
- bool TranslateTouchAction(int window, int touchAction, int touchPointers, int &action);
+ bool TranslateTouchAction(int touchAction, int touchPointers, int &window, int &action);
private:
typedef std::multimap<uint32_t, CButtonAction> buttonMap; // our button map to fill in
Please sign in to comment.
Something went wrong with that request. Please try again.