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

Dual-monitors on Linux return incorrect # & size of displays #667

Closed
larsiusprime opened this issue Jan 8, 2016 · 1 comment
Closed

Comments

@larsiusprime
Copy link
Contributor

I have two monitors connected to my Kubuntu machine, both 1080p.

xrandr returns this:

> xrandr
Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 32767 x 32767
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080      60.0*+   50.0     59.9  
   1920x1080i     60.1     50.0     60.0  
   1680x1050      59.9  
   1280x1024      75.0     60.0  
   1440x900       59.9  
   1280x960       60.0  
   1152x864       75.0  
   1280x720       60.0     50.0     59.9  
   1024x768       75.1     70.1     60.0  
   800x600        72.2     75.0     60.3     56.2  
   720x576        50.0  
   720x480        60.0     59.9  
   640x480        75.0     72.8     60.0     59.9  
   720x400        70.1  
DP1 disconnected (normal left inverted right x axis y axis)
HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 287mm
   1920x1080      60.0*+   50.0     59.9  
   1600x1200      60.0  
   1680x1050      59.9  
   1280x1024      60.0  
   1440x900       59.9  
   1280x960       60.0  
   1280x800       59.9  
   1280x720       60.0     50.0     59.9  
   1024x768       60.0  
   800x600        60.3     56.2  
   720x576        50.0  
   720x480        60.0     59.9  
   640x480        60.0     59.9  

But lime will return 1 for System.numDisplays and System.getDisplay(0) will return a display with a size of 3840x1080 (twice the horizontal size 1080p).

I traced this back to SDL, inserting printfs in SDLSystem.cpp indicates that the issue is with SDL_GetDisplayMode()and SDL_GetDisplayModes().

The SDL mailing list shows an identical issue reported in November 2013:
http://lists.libsdl.org/htdig.cgi/sdl-libsdl.org/2013-November/657727.html

This last email in the chain seems to propose a solution:
http://lists.libsdl.org/htdig.cgi/sdl-libsdl.org/2013-November/091991.html

I rebuilt SDL with X11MODES_DEBUG and the application started to work
normally...

So I removed X11MODES_DEBUG and the application still works (detect 2
displays: 0,0 1920x1080 / 1920, 0 1920x1080), so I suppose I made some
error in the build process (install SDL/build app/copy to the target
machine...) after I enabled both xinerama and xrandr....

The only problem I see NOW is that, if the frontmost window is the one NOT
in the screen with the gnome bar, the gnome bar is visible, but this is a
problem I can work around and it's probably in the window manager policy,
not SDL.

So, for future reference (and google searches that matches this thread), if
the multi monitor detection of SDL is not working you have to install
XRANDR and XINERAMA development packages, and recompile SDL.

If you have both xinerama and xrandr NOT available your desktop will be
probably detected as a single display as wide as the sum of your screens,
but you will not be able to display a fullscreen window in at least one of
them :)

I'm not quite sure what that last bit about installing XRANDR/XINERAMA means -- does it mean that if the developer has the right dependencies installed when they rebuild lime, that their app will work everywhere? Or will I have to take steps to make sure users install the right stuff too?

@ibilon
Copy link
Member

ibilon commented Jun 5, 2016

@larsiusprime the linked pr was merged, is that issue fixed?

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

No branches or pull requests

3 participants