@@ -104,7 +104,6 @@ internal partial class WindowImpl : IWindowImpl, EglGlPlatformSurface.IEglWindow
104
104
private bool _shown ;
105
105
private bool _hiddenWindowIsParent ;
106
106
private uint _langid ;
107
- private bool _ignoreDpiChanges ;
108
107
internal bool _ignoreWmChar ;
109
108
private WindowTransparencyLevel _transparencyLevel ;
110
109
private readonly WindowTransparencyLevel _defaultTransparencyLevel ;
@@ -730,20 +729,7 @@ public void SetParent(IWindowImpl? parent)
730
729
731
730
_hiddenWindowIsParent = parentHwnd == OffscreenParentWindow . Handle ;
732
731
733
- // I can't find mention of this *anywhere* online, but it seems that setting
734
- // GWL_HWNDPARENT to a window which is on the non-primary monitor can cause two
735
- // WM_DPICHANGED messages to be sent: the first changing the DPI to the parent's DPI,
736
- // then another changing the DPI back. This then causes Windows to provide an incorrect
737
- // suggested new rectangle to the WM_DPICHANGED message if the window is immediately
738
- // moved to the parent window's monitor (e.g. when using
739
- // WindowStartupLocation.CenterOwner) causing the window to be shown with an incorrect
740
- // size.
741
- //
742
- // Just ignore any WM_DPICHANGED while we're setting the parent as this shouldn't
743
- // change the DPI anyway.
744
- _ignoreDpiChanges = true ;
745
732
SetWindowLongPtr ( _hwnd , ( int ) WindowLongParam . GWL_HWNDPARENT , parentHwnd ) ;
746
- _ignoreDpiChanges = false ;
747
733
748
734
// Windows doesn't seem to respect the HWND_TOPMOST flag of a window when showing an owned window for the first time.
749
735
// So we set the HWND_TOPMOST again before the owned window is shown. This only needs to be done once.
0 commit comments