File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -859,14 +859,25 @@ private void OnGotInputWhenDisabled()
859
859
860
860
private void SetWindowStartupLocation ( IWindowBaseImpl owner = null )
861
861
{
862
+ var startupLocation = WindowStartupLocation ;
863
+
864
+ if ( startupLocation == WindowStartupLocation . CenterOwner &&
865
+ Owner is Window ownerWindow &&
866
+ ownerWindow . WindowState == WindowState . Minimized )
867
+ {
868
+ // If startup location is CenterOwner, but owner is minimized then fall back
869
+ // to CenterScreen. This behavior is consistent with WPF.
870
+ startupLocation = WindowStartupLocation . CenterScreen ;
871
+ }
872
+
862
873
var scaling = owner ? . DesktopScaling ?? PlatformImpl ? . DesktopScaling ?? 1 ;
863
874
864
875
// TODO: We really need non-client size here.
865
876
var rect = new PixelRect (
866
877
PixelPoint . Origin ,
867
878
PixelSize . FromSize ( ClientSize , scaling ) ) ;
868
879
869
- if ( WindowStartupLocation == WindowStartupLocation . CenterScreen )
880
+ if ( startupLocation == WindowStartupLocation . CenterScreen )
870
881
{
871
882
var screen = Screens . ScreenFromPoint ( owner ? . Position ?? Position ) ;
872
883
@@ -875,7 +886,7 @@ private void SetWindowStartupLocation(IWindowBaseImpl owner = null)
875
886
Position = screen . WorkingArea . CenterRect ( rect ) . Position ;
876
887
}
877
888
}
878
- else if ( WindowStartupLocation == WindowStartupLocation . CenterOwner )
889
+ else if ( startupLocation == WindowStartupLocation . CenterOwner )
879
890
{
880
891
if ( owner != null )
881
892
{
You can’t perform that action at this time.
0 commit comments