clowd / Clowd.Squirrel

Quick and easy installer and automatic updates for cross-platform dotnet applications
427 stars 39 forks source link

Win32splash renders in wrong location #173

Closed KennyTK closed 8 months ago

KennyTK commented 1 year ago

My screen dimensions are 1366 x 768 image

splash screen image: 620 x 135

squirrel.log with 2nd monitor plugged in: 2023-08-10 20:32:13.4173 [INFO] - User32SplashWindow: Image dpi is 95.9866, screen dpi is 96. Rendering image at [650,512,620,135]

squirrel.log with only main display: 2023-06-09 23:27:22.7488 [INFO] - User32SplashWindow: Image dpi is 95.9866, screen dpi is 96. Rendering image at [373,296,620,135]

It seems like the image position is correct when using one display. When I attach a 2nd display of different dimensions, the splash shifts to the bottom right quadrant of screen.

I think something weird is happening with MONITORINFO and specifically x = (mi.rcWork.Width - w) / 2; y = (mi.rcWork.Height - h) / 2;

x = (1366 - 620) / 2 = 373 =/= 650 y = (768 - 135) / 2 = 316.5 =/= 512

caesay commented 1 year ago

Thanks for reporting this, I'll have a look!

KennyTK commented 12 months ago

Working on a pr for this!

caesay commented 8 months ago

Fixed in v4

KennyTK commented 8 months ago

Did you fix by always loading on default display or by enumerating displays?