SFML community forums

Help => Window => Topic started by: Yoha on September 02, 2014, 04:36:46 pm

Title: Choose monitor
Post by: Yoha on September 02, 2014, 04:36:46 pm
Hello. I have not posted here in years, but I'm glad to see that my account is still accessible! This time, my Google-fu won't do, so I have to make a question on my own.

Consider a set-up with two different monitors:

$ xrandr
...
// secondary
   1360x768      60.02*+
   1920x1080     60.00    59.94    50.00    29.97    25.00    23.97    60.05    60.00    50.04
...
// primary
   1920x1080     60.00*+
...
 

sf::VideoMode::getFullscreenModes() returns:

3280×1080 32
1920×1080 32
...

Notice that 3280 = 1920 + 1360 is the total width of the desktop (additional question: how to detect these pseudo-modes?). The following lines are video modes for the secondary monitor. Subsequently, when using 1920x1080, the primary monitor is switched off and the resolution of the secondary is changed. SFML does not support dual fullscreen but…

Q: Is there a way to force SFML to use the primary monitor?

Edit: it might be the fault of xrandr which does not actually set the correct monitor as primary, even with --primary ; it might be useful to have a way to select a monitor through SFML but I am not sure it would be worth it before multiple monitors are supported.

Edit 2: this is apparently due to a bug in XFCE (https://bugzilla.xfce.org/show_bug.cgi?id=8328). The additional question remains:

Q: Can we distinguish video modes spanned over several monitors?
Title: Re: Choose monitor
Post by: zsbzsb on September 02, 2014, 05:14:18 pm
Quote
Q: Can we distinguish video modes spanned over several monitors?

Short answer: No.

Long answer: SFML does not properly support multiple monitor setups at all, this has been something that has long been wanted and long been planned to implement.

https://github.com/SFML/SFML/issues/188
Title: Re: Choose monitor
Post by: Yoha on September 02, 2014, 06:01:12 pm
Thanks for the clarification. For those interested, gnome-shell is as broken as xfce is when it comes to handling monitors.