From 40368666db72ca82147e2757890c38df0e327a81 Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 28 Jan 2026 18:54:56 +0000 Subject: [PATCH] ScopedThreadDPIAwarenessSetter: Allow null constructor argument --- modules/juce_gui_basics/native/juce_Windowing_windows.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp index 5df9d27788..759de12eeb 100644 --- a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp +++ b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp @@ -501,7 +501,7 @@ private: ScopedThreadDPIAwarenessSetter::ScopedThreadDPIAwarenessSetter (void* nativeWindow) { - pimpl = std::make_unique ((HWND) nativeWindow); + pimpl = nativeWindow != nullptr ? std::make_unique ((HWND) nativeWindow) : nullptr; } ScopedThreadDPIAwarenessSetter::~ScopedThreadDPIAwarenessSetter() = default; @@ -4315,6 +4315,7 @@ private: if (! hasMoved) flags |= SWP_NOMOVE; if (! hasResized) flags |= SWP_NOSIZE; + ScopedThreadDPIAwarenessSetter setter { hwnd }; SetWindowPos (hwnd, nullptr, newBounds.getX(), @@ -4324,9 +4325,7 @@ private: flags); if (hasResized && isValidPeer (this)) - { repaintNowIfTransparent(); - } } bool sendInputAttemptWhenModalMessage()