Browse Source

Fix windows/mingw build

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.5.0
falkTX 2 years ago
parent
commit
db71588a88
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 21 additions and 1 deletions
  1. +1
    -1
      source/modules/juce_gui_basics/juce_gui_basics.cpp
  2. +20
    -0
      source/modules/juce_gui_basics/native/juce_win32_Windowing.cpp

+ 1
- 1
source/modules/juce_gui_basics/juce_gui_basics.cpp View File

@@ -68,9 +68,9 @@
#include <commdlg.h>
#include <commctrl.h>
#include <sapi.h>
#include <Dxgi.h>
#if JUCE_MSVC
#include <Dxgi.h>
#include <UIAutomation.h>
#endif


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

@@ -1373,6 +1373,7 @@ private:
};
//==============================================================================
#if JUCE_MSVC
static HMONITOR getMonitorFromOutput (ComSmartPtr<IDXGIOutput> 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
}
//==============================================================================


Loading…
Cancel
Save