You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: HG 2.1 Reported for operating system, platform: Windows 10, x86_64
Comments on the original bug report:
On 2017-07-26 18:42:58 +0000, Eric Wasylishen wrote:
I set up an (admittedly exotic) 3-monitor setup, and when I enter fullscreen-desktop on the middle display (# 2), the SDL window is off center. (covers half of monitor # 2 and most of monitor # 3).
SDL display bounds:
INFO: Bounds: 1440x900 at 0,0
INFO: Bounds: 1281x801 at 1921,0 (these are incorrect)
INFO: Bounds: 1920x1080 at 4800,0
Correct bounds reported by calling EnumDisplayMonitors and printing the LPRECT param of the callback:
1440x900 at (0, 0)
1280x800 at (2880, 0)
1920x1080 at (4800, 0)
It seems like you need 3 displays to reproduce this, and the left two need DPI scaling, and the 3rd display needs to have a different scale factor than the others.
SDL: current hg (11235:43c7baa53681)
Windows 10, Version 10.0.15063 Build 15063
Tested with testdraw2 and testgl2, and pressing alt+enter to enter fullscreen desktop.
On 2017-08-11 07:18:13 +0000, Eric Wasylishen wrote:
Created attachment 2826
Possible patch
This patch reworks SDL_windowsmodes.c to use EnumDisplayMonitors instead of EnumDisplayDevices, so we always have an HMONITOR for each SDL display.
With access to an HMONITOR, we can get the monitor bounds in virtual screen coordinates the proper way, by calling GetMonitorInfo. (whereas the original code was doing some calculations - e.g. "data->DeviceMode.dmPosition.x * data->ScaleX" - to try to get virtual screen coordinates. These worked in simple cases, but failed in more complex cases like this bug)
The one potential problem with my patch is, the ChangeDisplaySettingsEx docs say that you're supposed to get the display name from EnumDisplayDevices, but I'm getting the display name from GetMonitorInfo now.
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: HG 2.1
Reported for operating system, platform: Windows 10, x86_64
Comments on the original bug report:
On 2017-07-26 18:42:58 +0000, Eric Wasylishen wrote:
On 2017-08-11 07:18:13 +0000, Eric Wasylishen wrote:
On 2017-08-11 17:19:01 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: