Browse Source

Fixed touch event bug on Windows where touches weren't being received when a modal dialog was open.

tags/2021-05-28
ed 9 years ago
parent
commit
7bd5c05216
2 changed files with 18 additions and 1 deletions
  1. +1
    -1
      modules/juce_core/native/juce_BasicNativeHeaders.h
  2. +17
    -0
      modules/juce_gui_basics/native/juce_win32_Windowing.cpp

+ 1
- 1
modules/juce_core/native/juce_BasicNativeHeaders.h View File

@@ -83,7 +83,7 @@
#if JUCE_MINGW
#define _WIN32_WINNT 0x0501
#else
#define _WIN32_WINNT 0x0600
#define _WIN32_WINNT 0x0602
#endif
#define _UNICODE 1
#define UNICODE 1


+ 17
- 0
modules/juce_gui_basics/native/juce_win32_Windowing.cpp View File

@@ -1304,6 +1304,9 @@ private:
case WM_NCMOUSEHOVER:
case WM_MOUSEHOVER:
case WM_TOUCH:
case WM_POINTERUPDATE:
case WM_POINTERDOWN:
case WM_POINTERUP:
return isHWNDBlockedByModalComponents (m.hwnd);
case WM_NCLBUTTONDOWN:
@@ -2032,6 +2035,17 @@ private:
return true;
}
TOUCHINPUT emulateTouchEventFromPointer (LPARAM lParam, WPARAM wParam)
{
TOUCHINPUT touchInput;
touchInput.dwID = GET_POINTERID_WPARAM (wParam);
touchInput.x = GET_X_LPARAM (lParam) * 100;
touchInput.y = GET_Y_LPARAM (lParam) * 100;
return touchInput;
}
//==============================================================================
void sendModifierKeyChangeIfNeeded()
{
@@ -2521,13 +2535,16 @@ private:
return 1;
//==============================================================================
case WM_POINTERUPDATE: handleTouchInput (emulateTouchEventFromPointer (lParam, wParam), false, false); return 0;
case WM_MOUSEMOVE: doMouseMove (getPointFromLParam (lParam), false); return 0;
case WM_MOUSELEAVE: doMouseExit(); return 0;
case WM_POINTERDOWN: handleTouchInput (emulateTouchEventFromPointer (lParam, wParam), true, false); return 0;
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN: doMouseDown (getPointFromLParam (lParam), wParam); return 0;
case WM_POINTERUP: handleTouchInput (emulateTouchEventFromPointer (lParam, wParam), false, true); return 0;
case WM_LBUTTONUP:
case WM_MBUTTONUP:
case WM_RBUTTONUP: doMouseUp (getPointFromLParam (lParam), wParam); return 0;


Loading…
Cancel
Save