Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use XRandR and Xinerama to get display info #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

randomnine
Copy link

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.

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, libxinerama-dev and a -clean build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant