[PATCH] Respect DISPLAY screen number in X11

I have a setup with one X11 display, which has two screens. These screens
are separate, they are not left, right, above, or below of one-another.
They are actually in completely different locations, so none of these
descriptions would make any sense.

I was not able to figure out how to get an SDL window (fullscreen or
otherwise) to show up on the second screen. No matter what I tried, it
always showed up on the first.

Also, the DISPLAY variable’s screen number was completely ignored.

While I believe there are still some issues left here, proper support of
the DISPLAY variable’s screen number was pretty trivial to add, and solved
my problems.

I believe this patch does not break the original design of how this was
supposed to work, as it only rearranges the order of the screens in the
list of modes (simply swapping the default screen to be first, if it isn’t
already).

Anything that looks through all the SDL displays will still see all the
displays’ modes, and will still get to select from them, just as before.

Anything that doesn’t check the displays, and just opens on the default
screen will now use the correct default screen, as specified in the DISPLAY
env var.

I tested this with both SDL2 FULLSCREEN_DESKTOP windows, and with
non-fullscreen windows, with both my first and second screens, and, with
this patch, they now all work fine.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL2_screen_from_DISPLAY.patch
Type: text/x-patch
Size: 1229 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20141008/78038e16/attachment-0001.bin

Hello,

(Just trying to help the development of SDL) It might be a good idea to also post this on the bug tracker, so this does not get lost in the mailing lists.

Cheers,
Jeffrey Carpenter
<@Jeffrey_Carpenter>On 2014/10/ 08, at 13:58, Steaphan Greene wrote:

I have a setup with one X11 display, which has two screens. These screens are separate, they are not left, right, above, or below of one-another. They are actually in completely different locations, so none of these descriptions would make any sense.

I was not able to figure out how to get an SDL window (fullscreen or otherwise) to show up on the second screen. No matter what I tried, it always showed up on the first.

Also, the DISPLAY variable’s screen number was completely ignored.

While I believe there are still some issues left here, proper support of the DISPLAY variable’s screen number was pretty trivial to add, and solved my problems.

I believe this patch does not break the original design of how this was supposed to work, as it only rearranges the order of the screens in the list of modes (simply swapping the default screen to be first, if it isn’t already).

Anything that looks through all the SDL displays will still see all the displays’ modes, and will still get to select from them, just as before.

Anything that doesn’t check the displays, and just opens on the default screen will now use the correct default screen, as specified in the DISPLAY env var.

I tested this with both SDL2 FULLSCREEN_DESKTOP windows, and with non-fullscreen windows, with both my first and second screens, and, with this patch, they now all work fine.
<SDL2_screen_from_DISPLAY.patch>_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Ooo, there is a bug tracker now?

It’s been several years since I’ve contributed to SDL… mercurial was a
surprise too. ;)On Wed, Oct 8, 2014 at 3:41 PM, Jeffrey Carpenter wrote:

Hello,

(Just trying to help the development of SDL) It might be a good idea to
also post this on the bug tracker, so this does not get lost in the mailing
lists.

Cheers,
Jeffrey Carpenter

On 2014/10/ 08, at 13:58, Steaphan Greene <@Steaphan_Greene> wrote:

I have a setup with one X11 display, which has two screens. These
screens are separate, they are not left, right, above, or below of
one-another. They are actually in completely different locations, so none
of these descriptions would make any sense.

I was not able to figure out how to get an SDL window (fullscreen or
otherwise) to show up on the second screen. No matter what I tried, it
always showed up on the first.

Also, the DISPLAY variable’s screen number was completely ignored.

While I believe there are still some issues left here, proper support of
the DISPLAY variable’s screen number was pretty trivial to add, and solved
my problems.

I believe this patch does not break the original design of how this was
supposed to work, as it only rearranges the order of the screens in the
list of modes (simply swapping the default screen to be first, if it isn’t
already).

Anything that looks through all the SDL displays will still see all the
displays’ modes, and will still get to select from them, just as before.

Anything that doesn’t check the displays, and just opens on the default
screen will now use the correct default screen, as specified in the DISPLAY
env var.

I tested this with both SDL2 FULLSCREEN_DESKTOP windows, and with
non-fullscreen windows, with both my first and second screens, and, with
this patch, they now all work fine.

<SDL2_screen_from_DISPLAY.patch>_______________________________________________

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

Related: https://bugzilla.libsdl.org/show_bug.cgi?id=2192On Oct 8, 2014, at 3:58 PM, Steaphan Greene wrote:

I have a setup with one X11 display, which has two screens. These screens are separate, they are not left, right, above, or below of one-another. They are actually in completely different locations, so none of these descriptions would make any sense.

I was not able to figure out how to get an SDL window (fullscreen or otherwise) to show up on the second screen. No matter what I tried, it always showed up on the first.

Also, the DISPLAY variable’s screen number was completely ignored.

Yes, indeed. I found that same one (now that I knew there was a bug
tracker!). I’ve attached this patch, and the relevant description to that
bug:

https://bugzilla.libsdl.org/show_bug.cgi?id=2192On Wed, Oct 8, 2014 at 5:15 PM, Alex Szpakowski wrote:

Related: https://bugzilla.libsdl.org/show_bug.cgi?id=2192

On Oct 8, 2014, at 3:58 PM, Steaphan Greene <@Steaphan_Greene> wrote:

I have a setup with one X11 display, which has two screens. These screens
are separate, they are not left, right, above, or below of one-another.
They are actually in completely different locations, so none of these
descriptions would make any sense.

I was not able to figure out how to get an SDL window (fullscreen or
otherwise) to show up on the second screen. No matter what I tried, it
always showed up on the first.

Also, the DISPLAY variable’s screen number was completely ignored.


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