diff --git a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp --- a/modules/juce_gui_basics/native/juce_Windowing_windows.cpp +++ b/modules/juce_gui_basics/native/juce_Windowing_windows.cpp @@ -4285,7 +4285,9 @@ private: if (getTransparencyKind() == TransparencyKind::perPixel) { - if (auto parentHwnd = GetParent (hwnd)) + // GetParent also returns the owner of an owned top-level window, whose + // coordinates are screen coordinates: only a real child peer is relative + if (auto parentHwnd = parentToAddTo) { const auto parentRect = (D2DUtilities::toRectangle (getWindowScreenRect (parentHwnd)).toFloat() / getPlatformScaleFactor()).toNearestInt(); newBounds += parentRect.getPosition();