Skip to content

Commit 4036866

Browse files
committed
ScopedThreadDPIAwarenessSetter: Allow null constructor argument
1 parent c2ba24b commit 4036866

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/juce_gui_basics/native/juce_Windowing_windows.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ class ScopedThreadDPIAwarenessSetter::NativeImpl
501501

502502
ScopedThreadDPIAwarenessSetter::ScopedThreadDPIAwarenessSetter (void* nativeWindow)
503503
{
504-
pimpl = std::make_unique<NativeImpl> ((HWND) nativeWindow);
504+
pimpl = nativeWindow != nullptr ? std::make_unique<NativeImpl> ((HWND) nativeWindow) : nullptr;
505505
}
506506

507507
ScopedThreadDPIAwarenessSetter::~ScopedThreadDPIAwarenessSetter() = default;
@@ -4315,6 +4315,7 @@ class HWNDComponentPeer final : public ComponentPeer
43154315
if (! hasMoved) flags |= SWP_NOMOVE;
43164316
if (! hasResized) flags |= SWP_NOSIZE;
43174317

4318+
ScopedThreadDPIAwarenessSetter setter { hwnd };
43184319
SetWindowPos (hwnd,
43194320
nullptr,
43204321
newBounds.getX(),
@@ -4324,9 +4325,7 @@ class HWNDComponentPeer final : public ComponentPeer
43244325
flags);
43254326

43264327
if (hasResized && isValidPeer (this))
4327-
{
43284328
repaintNowIfTransparent();
4329-
}
43304329
}
43314330

43324331
bool sendInputAttemptWhenModalMessage()

0 commit comments

Comments
 (0)