Use XRandR and Xinerama to get display info #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Linux specific. Solves a problem with fullscreen behaviour on multiple-monitor systems.
On Linux, default X11 behaviour seems to describe multiple monitors as a single virtual display (stretched across all physical monitors), so for example it might describe a pair of 1920x1080 monitors as a single 3840x1080 display. Full-screen SDL windows will therefore attempt to cover that 3840x1080 area and stretch across all displays instead of expanding to a single physical screen as they do on Windows and OS X.
SDL_x11modes.c appears to rely on XRandR (or possibly Xinerama) to get information on distinct screens within that virtual display. After enabling both here, fullscreen windows in Linux correctly take full screen on a single monitor.
Compiling requires additional packages libxrandr-dev and libxinerama-dev. When building this within Lime, I had to do a clean build for config changes to take effect.