11using System ;
2- using System . Collections . Generic ;
32using System . Diagnostics ;
43using System . Runtime . InteropServices ;
54using System . Threading ;
@@ -23,7 +22,6 @@ public class Application : IApplication
2322 private readonly IMetrics _metrics ;
2423 private readonly IInputProvider _inputProvider ;
2524 private readonly ILogger _logger ;
26- private readonly IList < string > _extensions ;
2725 private nint _windowHandle ;
2826
2927 private GL . GLDebugProc ? _debugProcCallback ;
@@ -197,6 +195,11 @@ protected virtual bool Initialize()
197195 var screenHeight = videoMode . Height ;
198196 DesiredFramerate = videoMode . RefreshRate ;
199197
198+ Glfw . GetMonitorPos (
199+ monitorHandle ,
200+ out var monitorLeft ,
201+ out var monitorTop ) ;
202+
200203 _applicationContext . ScreenSize = new Point ( screenWidth , screenHeight ) ;
201204 _applicationContext . WindowSize = windowResizable
202205 ? new Point ( _windowSettings . Value . ResolutionWidth , _windowSettings . Value . ResolutionHeight )
@@ -277,12 +280,12 @@ protected virtual bool Initialize()
277280 {
278281 Glfw . SetWindowPos (
279282 _windowHandle ,
280- screenWidth / 2 - _applicationContext . WindowSize . X / 2 ,
281- screenHeight / 2 - _applicationContext . WindowSize . Y / 2 ) ;
283+ screenWidth / 2 - _applicationContext . WindowSize . X / 2 + monitorLeft ,
284+ screenHeight / 2 - _applicationContext . WindowSize . Y / 2 + monitorTop ) ;
282285 }
283286 else
284287 {
285- Glfw . SetWindowPos ( _windowHandle , 0 , 0 ) ;
288+ Glfw . SetWindowPos ( _windowHandle , monitorLeft , monitorTop ) ;
286289 }
287290
288291 Glfw . GetFramebufferSize (
0 commit comments