SDL2 (2.0.1) inconsistent multiple display behaviour on linux

Maybe I miss something, but I think the behaviour of SDL2, at least on
linux, it’s not coehrent with multiple displays.

With 2 monitor attached on an ubuntu 12.04 box, with the following xrandr
output:

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 8192 x 8192
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1080+0+0 (normal left inverted right x axis y axis)
510mm x 290mm
1920x1080 60.0*+
1680x1050 60.0
1400x1050 60.0
1600x900 60.0
1280x1024 60.0
1440x900 59.9
1280x800 59.8
1152x864 60.0
1280x720 60.0
1024x768 60.0
800x600 60.3
640x480 60.0
HDMI2 connected 1920x1080+1920+0 (normal left inverted right x axis y axis)
510mm x 290mm
1920x1080 60.0*+
1680x1050 60.0
1400x1050 60.0
1600x900 60.0
1280x1024 75.0 60.0
1440x900 59.9
1280x800 59.8
1152x864 75.0
1280x720 60.0
1024x768 75.1 60.0
832x624 74.6
800x600 75.0 60.3 56.2
640x480 75.0 60.0
720x400 70.1

SDL_GetNumVideoDisplays();

Returns 1

SDL_GetDisplayBounds(0, rect);

Returns (0,0) (3840, 1080)

And this can BE ok, matches with the xrandr idea of “desktop”,

but a call to SDL_CreateWindow with SDL_WINDOW_FULLSCREEN_DESKTOP opens a
full screen window that spawn only one of the two monitors.

Also the behaviour of SDL_CreateWindow can be ok, if SDL provides a way to
"find" the screen that compose a particular part of the desktop, and a way
to go fullscreen in one or the other “monitor”.

At the moment I’ve not found a way also to open a fullscreen_desktop window
on the “left” part of this display…

It always go to the right part of the desktop (the secondary monitor) when
it goes fullscreen. I can position a window everywhere only in "windowed"
mode.

I’ve tried also with a few hints (permuations of
SDL_HINT_VIDEO_X11_XINERAMA, SDL_HINT_VIDEO_X11_XRANDR) to see if I could
change the SDL_GetDisplayBounds() or the SDL_CreateWindow behaviour but
without luck.

Also the macros SDL_WINDOWPOS_UNDEFINED_DISPLAY(X),
SDL_WINDOWPOS_CENTERED_DISPLAY(X) do not work since the display is only one
for the system.

GTK for instance provides this information using a two steps monitor
configuration, and if you move a window inside a particular monitor
(changing his x, y coordinates) and do gdk_window_fullscreen() the window
goes fullscreen on that particular desktop (and this is consistent both on
win32/macosx/linux):

GdkDisplay *display = gdk_display_get_default ();
int num_screen = gdk_display_get_n_screens (display);
std::cerr << "Default Display: " << (void*)display << ", available

screens: " << num_screen;

for (int i = 0; i < num_screen; ++i) {
    if (GdkScreen *screen = gdk_display_get_screen(display, i)) {
        int mons = gdk_screen_get_n_monitors(screen), j;
        std::cerr << "Number of monitors for screen " << (void*)screen

<< ": " << mons;
for (int j = 0; j < mons; ++j) {
GdkRectangle dest;
gdk_screen_get_monitor_geometry(screen, j, &dest);
std::cerr << "Monitor " << (j + 1) << ": " << dest.x <<
’,’ << dest.y << ‘,’ << dest.width << ‘,’ << dest.height;
[…]–
Bye,
Gabry

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I think you are right. Same problem here.Am 11.11.2013 18:47, schrieb Gabriele Greco:

Maybe I miss something, but I think the behaviour of SDL2, at least
on linux, it’s not coehrent with multiple displays.

With 2 monitor attached on an ubuntu 12.04 box, with the following
xrandr output:

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 8192 x
8192 VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1080+0+0 (normal left inverted right x axis y
axis) 510mm x 290mm 1920x1080 60.0*+ 1680x1050 60.0
1400x1050 60.0 1600x900 60.0 1280x1024 60.0
1440x900 59.9 1280x800 59.8 1152x864 60.0
1280x720 60.0 1024x768 60.0 800x600 60.3 640x480
60.0 HDMI2 connected 1920x1080+1920+0 (normal left inverted right x
axis y axis) 510mm x 290mm 1920x1080 60.0*+ 1680x1050
60.0 1400x1050 60.0 1600x900 60.0 1280x1024 75.0
60.0 1440x900 59.9 1280x800 59.8 1152x864 75.0
1280x720 60.0 1024x768 75.1 60.0 832x624
74.6 800x600 75.0 60.3 56.2 640x480 75.0
60.0 720x400 70.1

SDL_GetNumVideoDisplays();

Returns 1

SDL_GetDisplayBounds(0, rect);

Returns (0,0) (3840, 1080)

And this can BE ok, matches with the xrandr idea of “desktop”,

but a call to SDL_CreateWindow with SDL_WINDOW_FULLSCREEN_DESKTOP
opens a full screen window that spawn only one of the two
monitors.

Also the behaviour of SDL_CreateWindow can be ok, if SDL provides a
way to “find” the screen that compose a particular part of the
desktop, and a way to go fullscreen in one or the other “monitor”.

At the moment I’ve not found a way also to open a
fullscreen_desktop window on the “left” part of this display…

It always go to the right part of the desktop (the secondary
monitor) when it goes fullscreen. I can position a window
everywhere only in “windowed” mode.

I’ve tried also with a few hints (permuations of
SDL_HINT_VIDEO_X11_XINERAMA, SDL_HINT_VIDEO_X11_XRANDR) to see if I
could change the SDL_GetDisplayBounds() or the SDL_CreateWindow
behaviour but without luck.

Also the macros SDL_WINDOWPOS_UNDEFINED_DISPLAY(X),
SDL_WINDOWPOS_CENTERED_DISPLAY(X) do not work since the display is
only one for the system.

GTK for instance provides this information using a two steps
monitor configuration, and if you move a window inside a particular
monitor (changing his x, y coordinates) and do
gdk_window_fullscreen() the window goes fullscreen on that
particular desktop (and this is consistent both on
win32/macosx/linux):

GdkDisplay display = gdk_display_get_default (); int num_screen =
gdk_display_get_n_screens (display); std::cerr << “Default Display:
” << (void
)display << ", available screens: " << num_screen;

for (int i = 0; i < num_screen; ++i) { if (GdkScreen screen =
gdk_display_get_screen(display, i)) { int mons =
gdk_screen_get_n_monitors(screen), j; std::cerr << "Number of
monitors for screen " << (void
)screen << ": " << mons; for (int j
= 0; j < mons; ++j) { GdkRectangle dest;
gdk_screen_get_monitor_geometry(screen, j, &dest); std::cerr <<
"Monitor " << (j + 1) << ": " << dest.x << ‘,’ << dest.y << ‘,’ <<
dest.width << ‘,’ << dest.height; […]

_______________________________________________ SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSgRqMAAoJEKgQxhH98B0TnloH/3eCw2quuUQB0EpBoYTbBnUI
0bTJg8Udt/ypzdpr5U3yx4LFIBVAl4qNg//eT3W8m7FzalfBPOvbUJ1ne0cn4iHh
x2DuW+O1bpA7jUUGtyaEkqhrQwXZAHJ6HmnIfU067yU8Jc166s6hiSulepvLWMrg
wL7c9b2DXhz4b1cd/IGaRxfsVG3G1hQ6RbX3QViecCqw1bjZZJ5W2FYp98lVU+cS
Jab78itJJL7+ri7dbajbdNV8sdAxleFRy2vbUtaXTf5bviX3WtRVXbBPFgkzpsGh
ATmPbidXcx12oKy8zee7tB1wXTgajJ7MFDorIOt2qu00iQjPxGsr7vpXZURsmNw=
=66PE
-----END PGP SIGNATURE-----

Are you sure you built SDL with xrandr support and it’s being loaded
correctly? SDL should be detecting the displays and geometry the same way
GDK is here.On Mon, Nov 11, 2013 at 9:47 AM, Gabriele Greco <gabriele.greco at darts.it>wrote:

Maybe I miss something, but I think the behaviour of SDL2, at least on
linux, it’s not coehrent with multiple displays.

With 2 monitor attached on an ubuntu 12.04 box, with the following xrandr
output:

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 8192 x 8192
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1080+0+0 (normal left inverted right x axis y axis)
510mm x 290mm
1920x1080 60.0*+
1680x1050 60.0
1400x1050 60.0
1600x900 60.0
1280x1024 60.0
1440x900 59.9
1280x800 59.8
1152x864 60.0
1280x720 60.0
1024x768 60.0
800x600 60.3
640x480 60.0
HDMI2 connected 1920x1080+1920+0 (normal left inverted right x axis y
axis) 510mm x 290mm
1920x1080 60.0*+
1680x1050 60.0
1400x1050 60.0
1600x900 60.0
1280x1024 75.0 60.0
1440x900 59.9
1280x800 59.8
1152x864 75.0
1280x720 60.0
1024x768 75.1 60.0
832x624 74.6
800x600 75.0 60.3 56.2
640x480 75.0 60.0
720x400 70.1

SDL_GetNumVideoDisplays();

Returns 1

SDL_GetDisplayBounds(0, rect);

Returns (0,0) (3840, 1080)

And this can BE ok, matches with the xrandr idea of “desktop”,

but a call to SDL_CreateWindow with SDL_WINDOW_FULLSCREEN_DESKTOP opens a
full screen window that spawn only one of the two monitors.

Also the behaviour of SDL_CreateWindow can be ok, if SDL provides a way to
"find" the screen that compose a particular part of the desktop, and a way
to go fullscreen in one or the other “monitor”.

At the moment I’ve not found a way also to open a fullscreen_desktop
window on the “left” part of this display…

It always go to the right part of the desktop (the secondary monitor) when
it goes fullscreen. I can position a window everywhere only in "windowed"
mode.

I’ve tried also with a few hints (permuations of
SDL_HINT_VIDEO_X11_XINERAMA, SDL_HINT_VIDEO_X11_XRANDR) to see if I could
change the SDL_GetDisplayBounds() or the SDL_CreateWindow behaviour but
without luck.

Also the macros SDL_WINDOWPOS_UNDEFINED_DISPLAY(X),
SDL_WINDOWPOS_CENTERED_DISPLAY(X) do not work since the display is only one
for the system.

GTK for instance provides this information using a two steps monitor
configuration, and if you move a window inside a particular monitor
(changing his x, y coordinates) and do gdk_window_fullscreen() the window
goes fullscreen on that particular desktop (and this is consistent both on
win32/macosx/linux):

GdkDisplay *display = gdk_display_get_default ();
int num_screen = gdk_display_get_n_screens (display);
std::cerr << "Default Display: " << (void*)display << ", available

screens: " << num_screen;

for (int i = 0; i < num_screen; ++i) {
    if (GdkScreen *screen = gdk_display_get_screen(display, i)) {
        int mons = gdk_screen_get_n_monitors(screen), j;
        std::cerr << "Number of monitors for screen " << (void*)screen

<< ": " << mons;
for (int j = 0; j < mons; ++j) {
GdkRectangle dest;
gdk_screen_get_monitor_geometry(screen, j, &dest);
std::cerr << "Monitor " << (j + 1) << ": " << dest.x <<
’,’ << dest.y << ‘,’ << dest.width << ‘,’ << dest.height;
[…]


Bye,
Gabry


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

You are right about compiling, I reconfigured to check if xrandr support
was present and saw this:

checking for X11/extensions/Xrandr.h… no

Now I installed the xrandr-dev package and I get this:

checking for X11/extensions/Xrandr.h… yes
– dynamic libXrandr -> libXrandr.so.2

With the library compiled with xrandr support the SDL behaviour changed…
in worse :slight_smile:

Now I get a single “display” from SDL_GetNumVideoDisplays() with a
resolution of 1920x1024!

Since autoconf said:

checking for X11/Xcursor/Xcursor.h… no
checking for X11/extensions/Xinerama.h… no
checking for X11/extensions/XInput2.h… no
checking for X11/extensions/Xrandr.h… yes
– dynamic libXrandr -> libXrandr.so.2
checking for X11/extensions/scrnsaver.h… no
checking for X11/extensions/shape.h… yes
checking for X11/extensions/xf86vmode.h… no

I tried to add also the addictional packages that provide X11
header/libraries to enable everything (except screensaver that I did not
found the right package):

checking for X11/Xcursor/Xcursor.h… yes
– dynamic libXcursor -> libXcursor.so.1
checking for X11/extensions/Xinerama.h… yes
– dynamic libXinerama -> libXinerama.so.1
checking for X11/extensions/XInput2.h… yes
– dynamic libXi -> libXi.so.6
checking for xinput2 multitouch… yes
checking for X11/extensions/Xrandr.h… yes
– dynamic libXrandr -> libXrandr.so.2
checking for X11/extensions/scrnsaver.h… no
checking for X11/extensions/shape.h… yes
checking for X11/extensions/xf86vmode.h… yes
– dynamic libXxf86vm -> libXxf86vm.so.1

I configure with only “–disable-shared”.

… no difference from the xrandr only case… (single video display
1920x1080)

And yes, the target machine has the libraries needed:

ii libxrandr2 2:1.3.2-2
X11 RandR extension library
ii libxinerama1 2:1.1.1-3build1
X11 Xinerama extension library

PS: the develoment machine is ubuntu and the target machine is mint, but
they are almost the same thing (at least version-wise):

ii libxrandr-dev 2:1.3.2-2ubuntu0.2
X11 RandR extension library (development headers)
ii libxrandr2 2:1.3.2-2ubuntu0.2
X11 RandR extension library
ii libxinerama-dev 2:1.1.1-3ubuntu0.1
X11 Xinerama extension library (development headers)
ii libxinerama1 2:1.1.1-3ubuntu0.1
X11 Xinerama extension library
ii x11proto-xinerama-dev 1.2.1-2
X11 Xinerama extension wire protocolOn Tue, Nov 12, 2013 at 11:32 AM, Sam Lantinga wrote:

Are you sure you built SDL with xrandr support and it’s being loaded
correctly? SDL should be detecting the displays and geometry the same way
GDK is here.

On Mon, Nov 11, 2013 at 9:47 AM, Gabriele Greco <@Gabriele_Greco>wrote:

Maybe I miss something, but I think the behaviour of SDL2, at least on
linux, it’s not coehrent with multiple displays.

With 2 monitor attached on an ubuntu 12.04 box, with the following xrandr
output:

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 8192 x 8192
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1080+0+0 (normal left inverted right x axis y axis)
510mm x 290mm
1920x1080 60.0*+
1680x1050 60.0
1400x1050 60.0
1600x900 60.0
1280x1024 60.0
1440x900 59.9
1280x800 59.8
1152x864 60.0
1280x720 60.0
1024x768 60.0
800x600 60.3
640x480 60.0
HDMI2 connected 1920x1080+1920+0 (normal left inverted right x axis y
axis) 510mm x 290mm
1920x1080 60.0*+
1680x1050 60.0
1400x1050 60.0
1600x900 60.0
1280x1024 75.0 60.0
1440x900 59.9
1280x800 59.8
1152x864 75.0
1280x720 60.0
1024x768 75.1 60.0
832x624 74.6
800x600 75.0 60.3 56.2
640x480 75.0 60.0
720x400 70.1

SDL_GetNumVideoDisplays();

Returns 1

SDL_GetDisplayBounds(0, rect);

Returns (0,0) (3840, 1080)

And this can BE ok, matches with the xrandr idea of “desktop”,

but a call to SDL_CreateWindow with SDL_WINDOW_FULLSCREEN_DESKTOP opens
a full screen window that spawn only one of the two monitors.

Also the behaviour of SDL_CreateWindow can be ok, if SDL provides a way
to “find” the screen that compose a particular part of the desktop, and a
way to go fullscreen in one or the other “monitor”.

At the moment I’ve not found a way also to open a fullscreen_desktop
window on the “left” part of this display…

It always go to the right part of the desktop (the secondary monitor)
when it goes fullscreen. I can position a window everywhere only in
"windowed" mode.

I’ve tried also with a few hints (permuations of
SDL_HINT_VIDEO_X11_XINERAMA, SDL_HINT_VIDEO_X11_XRANDR) to see if I could
change the SDL_GetDisplayBounds() or the SDL_CreateWindow behaviour but
without luck.

Also the macros SDL_WINDOWPOS_UNDEFINED_DISPLAY(X),
SDL_WINDOWPOS_CENTERED_DISPLAY(X) do not work since the display is only one
for the system.

GTK for instance provides this information using a two steps monitor
configuration, and if you move a window inside a particular monitor
(changing his x, y coordinates) and do gdk_window_fullscreen() the window
goes fullscreen on that particular desktop (and this is consistent both on
win32/macosx/linux):

GdkDisplay *display = gdk_display_get_default ();
int num_screen = gdk_display_get_n_screens (display);
std::cerr << "Default Display: " << (void*)display << ", available

screens: " << num_screen;

for (int i = 0; i < num_screen; ++i) {
    if (GdkScreen *screen = gdk_display_get_screen(display, i)) {
        int mons = gdk_screen_get_n_monitors(screen), j;
        std::cerr << "Number of monitors for screen " <<

(void*)screen << ": " << mons;
for (int j = 0; j < mons; ++j) {
GdkRectangle dest;
gdk_screen_get_monitor_geometry(screen, j, &dest);
std::cerr << "Monitor " << (j + 1) << ": " << dest.x <<
’,’ << dest.y << ‘,’ << dest.width << ‘,’ << dest.height;
[…]


Bye,
Gabry


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0100980150 Fax: +39-0100980184
s-mail: Piazza Della Vittoria 9/3 - 16121 GENOVA (ITALY)

Do you get the same result without using “–disable-shared”?

There’s also a #define at the top of SDL_x11modes.c that will make it
output a few bits of debugging info…info that we should expand probably,
but it will at least tell you if it’s actually using Xinerama/Xrandr/etc

2013/11/12 Gabriele Greco <gabriele.greco at darts.it>> You are right about compiling, I reconfigured to check if xrandr support

was present and saw this:

checking for X11/extensions/Xrandr.h… no

Now I installed the xrandr-dev package and I get this:

checking for X11/extensions/Xrandr.h… yes
– dynamic libXrandr -> libXrandr.so.2

With the library compiled with xrandr support the SDL behaviour changed…
in worse :slight_smile:

Now I get a single “display” from SDL_GetNumVideoDisplays() with a
resolution of 1920x1024!

Since autoconf said:

checking for X11/Xcursor/Xcursor.h… no
checking for X11/extensions/Xinerama.h… no
checking for X11/extensions/XInput2.h… no
checking for X11/extensions/Xrandr.h… yes
– dynamic libXrandr -> libXrandr.so.2
checking for X11/extensions/scrnsaver.h… no
checking for X11/extensions/shape.h… yes
checking for X11/extensions/xf86vmode.h… no

I tried to add also the addictional packages that provide X11
header/libraries to enable everything (except screensaver that I did not
found the right package):

checking for X11/Xcursor/Xcursor.h… yes
– dynamic libXcursor -> libXcursor.so.1
checking for X11/extensions/Xinerama.h… yes
– dynamic libXinerama -> libXinerama.so.1
checking for X11/extensions/XInput2.h… yes
– dynamic libXi -> libXi.so.6
checking for xinput2 multitouch… yes
checking for X11/extensions/Xrandr.h… yes
– dynamic libXrandr -> libXrandr.so.2
checking for X11/extensions/scrnsaver.h… no
checking for X11/extensions/shape.h… yes
checking for X11/extensions/xf86vmode.h… yes
– dynamic libXxf86vm -> libXxf86vm.so.1

I configure with only “–disable-shared”.

… no difference from the xrandr only case… (single video display
1920x1080)

And yes, the target machine has the libraries needed:

ii libxrandr2 2:1.3.2-2
X11 RandR extension library
ii libxinerama1 2:1.1.1-3build1
X11 Xinerama extension library

PS: the develoment machine is ubuntu and the target machine is mint, but
they are almost the same thing (at least version-wise):

ii libxrandr-dev 2:1.3.2-2ubuntu0.2
X11 RandR extension library (development headers)
ii libxrandr2 2:1.3.2-2ubuntu0.2
X11 RandR extension library
ii libxinerama-dev 2:1.1.1-3ubuntu0.1
X11 Xinerama extension library (development headers)
ii libxinerama1 2:1.1.1-3ubuntu0.1
X11 Xinerama extension library
ii x11proto-xinerama-dev 1.2.1-2
X11 Xinerama extension wire protocol

On Tue, Nov 12, 2013 at 11:32 AM, Sam Lantinga wrote:

Are you sure you built SDL with xrandr support and it’s being loaded
correctly? SDL should be detecting the displays and geometry the same way
GDK is here.

On Mon, Nov 11, 2013 at 9:47 AM, Gabriele Greco <gabriele.greco at darts.it>wrote:

Maybe I miss something, but I think the behaviour of SDL2, at least on
linux, it’s not coehrent with multiple displays.

With 2 monitor attached on an ubuntu 12.04 box, with the following
xrandr output:

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 8192 x 8192
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1080+0+0 (normal left inverted right x axis y axis)
510mm x 290mm
1920x1080 60.0*+
1680x1050 60.0
1400x1050 60.0
1600x900 60.0
1280x1024 60.0
1440x900 59.9
1280x800 59.8
1152x864 60.0
1280x720 60.0
1024x768 60.0
800x600 60.3
640x480 60.0
HDMI2 connected 1920x1080+1920+0 (normal left inverted right x axis y
axis) 510mm x 290mm
1920x1080 60.0*+
1680x1050 60.0
1400x1050 60.0
1600x900 60.0
1280x1024 75.0 60.0
1440x900 59.9
1280x800 59.8
1152x864 75.0
1280x720 60.0
1024x768 75.1 60.0
832x624 74.6
800x600 75.0 60.3 56.2
640x480 75.0 60.0
720x400 70.1

SDL_GetNumVideoDisplays();

Returns 1

SDL_GetDisplayBounds(0, rect);

Returns (0,0) (3840, 1080)

And this can BE ok, matches with the xrandr idea of “desktop”,

but a call to SDL_CreateWindow with SDL_WINDOW_FULLSCREEN_DESKTOP opens
a full screen window that spawn only one of the two monitors.

Also the behaviour of SDL_CreateWindow can be ok, if SDL provides a way
to “find” the screen that compose a particular part of the desktop, and a
way to go fullscreen in one or the other “monitor”.

At the moment I’ve not found a way also to open a fullscreen_desktop
window on the “left” part of this display…

It always go to the right part of the desktop (the secondary monitor)
when it goes fullscreen. I can position a window everywhere only in
"windowed" mode.

I’ve tried also with a few hints (permuations of
SDL_HINT_VIDEO_X11_XINERAMA, SDL_HINT_VIDEO_X11_XRANDR) to see if I could
change the SDL_GetDisplayBounds() or the SDL_CreateWindow behaviour but
without luck.

Also the macros SDL_WINDOWPOS_UNDEFINED_DISPLAY(X),
SDL_WINDOWPOS_CENTERED_DISPLAY(X) do not work since the display is only one
for the system.

GTK for instance provides this information using a two steps monitor
configuration, and if you move a window inside a particular monitor
(changing his x, y coordinates) and do gdk_window_fullscreen() the window
goes fullscreen on that particular desktop (and this is consistent both on
win32/macosx/linux):

GdkDisplay *display = gdk_display_get_default ();
int num_screen = gdk_display_get_n_screens (display);
std::cerr << "Default Display: " << (void*)display << ", available

screens: " << num_screen;

for (int i = 0; i < num_screen; ++i) {
    if (GdkScreen *screen = gdk_display_get_screen(display, i)) {
        int mons = gdk_screen_get_n_monitors(screen), j;
        std::cerr << "Number of monitors for screen " <<

(void*)screen << ": " << mons;
for (int j = 0; j < mons; ++j) {
GdkRectangle dest;
gdk_screen_get_monitor_geometry(screen, j, &dest);
std::cerr << "Monitor " << (j + 1) << ": " << dest.x <<
’,’ << dest.y << ‘,’ << dest.width << ‘,’ << dest.height;
[…]


Bye,
Gabry


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0100980150 Fax: +39-0100980184
s-mail: Piazza Della Vittoria 9/3 - 16121 GENOVA (ITALY)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.

Do you get the same result without using “–disable-shared”?

There’s also a #define at the top of SDL_x11modes.c that will make it
output a few bits of debugging info…info that we should expand probably,
but it will at least tell you if it’s actually using Xinerama/Xrandr/etc

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 :)On Tue, Nov 12, 2013 at 1:17 PM, Gabriel Jacobo wrote:


Bye,
Gabry