From 940ff3ee6e273dcf74bf260c3449d4c17db8f1bf Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 19 Jun 2017 16:28:55 +0100 Subject: [PATCH] Fixed a bug in iOS and Windows multi-touch code where touches on different windows weren't aware of each other --- .../juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm | 4 +++- modules/juce_gui_basics/native/juce_win32_Windowing.cpp | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm index a2d7203cf7..14f77534de 100644 --- a/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm @@ -285,7 +285,7 @@ public: return r; } - MultiTouchMapper currentTouches; + static MultiTouchMapper currentTouches; private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (UIViewComponentPeer) @@ -324,6 +324,8 @@ static bool isKioskModeView (JuceUIViewController* c) return Desktop::getInstance().getKioskModeComponent() == &(juceView->owner->getComponent()); } +MultiTouchMapper UIViewComponentPeer::currentTouches; + } // (juce namespace) diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index 14b25ade21..8be1926f09 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -1461,11 +1461,12 @@ private: FileDropTarget* dropTarget = nullptr; uint8 updateLayeredWindowAlpha = 255; UWPUIViewSettings uwpViewSettings; - MultiTouchMapper currentTouches; #if JUCE_MODULE_AVAILABLE_juce_audio_plugin_client ModifierKeyProvider* modProvider = nullptr; #endif + static MultiTouchMapper currentTouches; + //============================================================================== struct TemporaryImage : private Timer { @@ -3499,6 +3500,8 @@ private: ModifierKeys HWNDComponentPeer::currentModifiers; ModifierKeys HWNDComponentPeer::modifiersAtLastCallback; +MultiTouchMapper HWNDComponentPeer::currentTouches; + ComponentPeer* Component::createNewPeer (int styleFlags, void* parentHWND) { return new HWNDComponentPeer (*this, styleFlags, (HWND) parentHWND, false);