File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/BizHawk.Client.EmuHawk/Extensions Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -87,9 +87,11 @@ public static DialogResult ShowDialogOnScreen(this Form form)
8787 var topLeft = new Point (
8888 Math . Max ( 0 , form . Location . X ) ,
8989 Math . Max ( 0 , form . Location . Y ) ) ;
90- var screen = Screen . AllScreens . First ( s => s . WorkingArea . Contains ( topLeft ) ) ;
91- var w = screen . WorkingArea . Right - form . Bounds . Right ;
92- var h = screen . WorkingArea . Bottom - form . Bounds . Bottom ;
90+ var screen = Screen . AllScreens . Select ( static s => s . WorkingArea )
91+ . FirstOrNull ( a => a . Contains ( topLeft ) )
92+ ?? default ; //TODO is zeroed the correct fallback value? --yoshi
93+ var w = screen . Right - form . Bounds . Right ;
94+ var h = screen . Bottom - form . Bounds . Bottom ;
9395 if ( h < 0 ) topLeft . Y += h ;
9496 if ( w < 0 ) topLeft . X += w ;
9597 form . SetDesktopLocation ( topLeft . X , topLeft . Y ) ;
You can’t perform that action at this time.
0 commit comments