mirror of https://github.com/encounter/SDL.git
6e1b11bae4
Eric Wasylishen 2017-07-26 18:42:58 UTC 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). The displays are arranged from left to right: Display #1 (main): 2880x1800, 200% scaling Display #2: 1920x1200, 150% scaling Display #3: 1920x1080, 100% scaling 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. Related: https://bugzilla.libsdl.org/show_bug.cgi?id=3709 SDL: current hg (11235:6a587b9e0ec8) Windows 10, Version 10.0.15063 Build 15063 Tested with testdraw2 and testgl2, and pressing alt+enter to enter fullscreen desktop. 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. |
||
---|---|---|
VisualC | ||
VisualC-WinRT | ||
Xcode | ||
Xcode-iOS | ||
acinclude | ||
android-project | ||
build-scripts | ||
cmake | ||
debian | ||
docs | ||
include | ||
src | ||
test | ||
visualtest | ||
.hgignore | ||
Android.mk | ||
BUGS.txt | ||
CMakeLists.txt | ||
COPYING.txt | ||
CREDITS.txt | ||
INSTALL.txt | ||
Makefile.in | ||
Makefile.minimal | ||
Makefile.pandora | ||
Makefile.psp | ||
Makefile.wiz | ||
README-SDL.txt | ||
README.txt | ||
SDL2.spec.in | ||
SDL2Config.cmake | ||
TODO.txt | ||
VisualC.html | ||
WhatsNew.txt | ||
autogen.sh | ||
cmake_uninstall.cmake.in | ||
configure | ||
configure.in | ||
sdl2-config.cmake.in | ||
sdl2-config.in | ||
sdl2.m4 | ||
sdl2.pc.in |
README.txt
Simple DirectMedia Layer (SDL) Version 2.0 --- https://www.libsdl.org/ Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games. More extensive documentation is available in the docs directory, starting with README.md Enjoy! Sam Lantinga (slouken@libsdl.org)