From db71588a88fb6d79149343d3f199b361ba9db00c Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 14 Jul 2022 15:20:53 +0100 Subject: [PATCH] Fix windows/mingw build Signed-off-by: falkTX --- .../juce_gui_basics/juce_gui_basics.cpp | 2 +- .../native/juce_win32_Windowing.cpp | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/source/modules/juce_gui_basics/juce_gui_basics.cpp b/source/modules/juce_gui_basics/juce_gui_basics.cpp index 944d25b1c..574229cab 100644 --- a/source/modules/juce_gui_basics/juce_gui_basics.cpp +++ b/source/modules/juce_gui_basics/juce_gui_basics.cpp @@ -68,9 +68,9 @@ #include #include #include - #include #if JUCE_MSVC + #include #include #endif diff --git a/source/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/source/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index 7a012c39c..f141d5885 100644 --- a/source/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/source/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -1373,6 +1373,7 @@ private: }; //============================================================================== +#if JUCE_MSVC static HMONITOR getMonitorFromOutput (ComSmartPtr output) { DXGI_OUTPUT_DESC desc = {}; @@ -1614,10 +1615,13 @@ private: }; JUCE_IMPLEMENT_SINGLETON (VBlankDispatcher) +#endif //============================================================================== class HWNDComponentPeer : public ComponentPeer, + #if JUCE_MSVC private VBlankListener, + #endif private Timer #if JUCE_MODULE_AVAILABLE_juce_audio_plugin_client , public ModifierKeyReceiver @@ -1656,13 +1660,19 @@ public: return ModifierKeys::currentModifiers; }; + #if JUCE_MSVC if (updateCurrentMonitor()) VBlankDispatcher::getInstance()->updateDisplay (*this, currentMonitor); + #else + updateCurrentMonitor(); + #endif } ~HWNDComponentPeer() override { + #if JUCE_MSVC VBlankDispatcher::getInstance()->removeListener (*this); + #endif // do this first to avoid messages arriving for this window before it's destroyed JuceWindowIdentifier::setAsJUCEWindow (hwnd, false); @@ -2072,10 +2082,12 @@ public: } //============================================================================== + #if JUCE_MSVC void onVBlank() override { dispatchDeferredRepaints(); } + #endif //============================================================================== static HWNDComponentPeer* getOwnerOfWindow (HWND h) noexcept @@ -3674,8 +3686,12 @@ private: handleMovedOrResized(); + #if JUCE_MSVC if (updateCurrentMonitor()) VBlankDispatcher::getInstance()->updateDisplay (*this, currentMonitor); + #else + updateCurrentMonitor(); + #endif return ! dontRepaint; // to allow non-accelerated openGL windows to draw themselves correctly. } @@ -3831,10 +3847,14 @@ private: .getDisplayForRect (component.getScreenBounds())->userArea), SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOSENDCHANGING); + #if JUCE_MSVC auto* dispatcher = VBlankDispatcher::getInstance(); dispatcher->reconfigureDisplays(); updateCurrentMonitor(); dispatcher->updateDisplay (*this, currentMonitor); + #else + updateCurrentMonitor(); + #endif } //==============================================================================