Documentation of fullscreen on Linux?

Is there any documentation or sample code for implementing fullscreen SDL2
programs on Linux? I cannot get either hardware or windowed fullscreen to
work on my machine (running Ubuntu 13.04). I also tried using the SDL
Renderer-based method described at
http://wiki.libsdl.org/moin.fcg/MigrationGuide, but that did not work
either.

There is a huge amount of discussion online around how to implement SDL2
fullscreen on Linux, but I can’t find any description of a working solution.

If someone can point me to a working example, that would be ideal. Thanks!

Keith Holman
Zachtronics

One solution I used that worked was enumerating the displays, getting the
bounding box of the display I want, and creating a borderless window that
size at that display’s position. It worked in Ubuntu 12 LTS with a few
revisions back.On Tue, Aug 13, 2013 at 8:42 PM, Keith Holman wrote:

Is there any documentation or sample code for implementing fullscreen SDL2
programs on Linux? I cannot get either hardware or windowed fullscreen to
work on my machine (running Ubuntu 13.04). I also tried using the SDL
Renderer-based method described at
http://wiki.libsdl.org/moin.fcg/MigrationGuide, but that did not work
either.

There is a huge amount of discussion online around how to implement SDL2
fullscreen on Linux, but I can’t find any description of a working solution.

If someone can point me to a working example, that would be ideal. Thanks!

Keith Holman
Zachtronics


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

Just use SDL_WINDOW_FULLSCREEN_DESKTOP, it determines the native resolution
automatically! =)

2013/8/14 Alex Barry <alex.barry at gmail.com>> One solution I used that worked was enumerating the displays, getting the

bounding box of the display I want, and creating a borderless window that
size at that display’s position. It worked in Ubuntu 12 LTS with a few
revisions back.

On Tue, Aug 13, 2013 at 8:42 PM, Keith Holman wrote:

Is there any documentation or sample code for implementing fullscreen
SDL2 programs on Linux? I cannot get either hardware or windowed fullscreen
to work on my machine (running Ubuntu 13.04). I also tried using the SDL
Renderer-based method described at
http://wiki.libsdl.org/moin.fcg/MigrationGuide, but that did not work
either.

There is a huge amount of discussion online around how to implement SDL2
fullscreen on Linux, but I can’t find any description of a working solution.

If someone can point me to a working example, that would be ideal. Thanks!

Keith Holman
Zachtronics


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

He explicitly said windowed fullscreen isn’t working either.

Is Unity (the shell) running, by any chance? Because I noticed that
thing seems to like getting in the way of fullscreen in just about
every way possible, even fake fullscreen… sigh

2013/8/14, Jonas Kulla :> Just use SDL_WINDOW_FULLSCREEN_DESKTOP, it determines the native resolution

automatically! =)

2013/8/14 Alex Barry <alex.barry at gmail.com>

One solution I used that worked was enumerating the displays, getting the
bounding box of the display I want, and creating a borderless window that
size at that display’s position. It worked in Ubuntu 12 LTS with a few
revisions back.

On Tue, Aug 13, 2013 at 8:42 PM, Keith Holman wrote:

Is there any documentation or sample code for implementing fullscreen
SDL2 programs on Linux? I cannot get either hardware or windowed
fullscreen
to work on my machine (running Ubuntu 13.04). I also tried using the SDL
Renderer-based method described at
http://wiki.libsdl.org/moin.fcg/MigrationGuide, but that did not work
either.

There is a huge amount of discussion online around how to implement SDL2
fullscreen on Linux, but I can’t find any description of a working
solution.

If someone can point me to a working example, that would be ideal.
Thanks!

Keith Holman
Zachtronics


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

Hi Keith,
Here’s a sample program I just stripped out from something slightly larger.
This works fine for me on Ubuntu 12.04. Press alt-enter to toggle
fullscreen.–
Terry Welsh
www.reallyslick.com

Is there any documentation or sample code for implementing fullscreen SDL2
programs on Linux? I cannot get either hardware or windowed fullscreen to
work on my machine (running Ubuntu 13.04). I also tried using the SDL
Renderer-based method described at
http://wiki.libsdl.org/moin.fcg/MigrationGuide, but that did not work
either.

There is a huge amount of discussion online around how to implement SDL2
fullscreen on Linux, but I can’t find any description of a working
solution.

If someone can point me to a working example, that would be ideal. Thanks!

Keith Holman
Zachtronics

-------------- next part --------------
A non-text attachment was scrubbed…
Name: main.cpp
Type: text/x-c++src
Size: 2048 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130813/53504af7/attachment.cpp

Thanks for the sample code, but it does not work for me on 13.04. When I
toggle it into fullscreen, the window either minimizes or disappears
completely, and the program becomes unresponsive. I slightly modified your
sample program to render something so that I could be sure it was
displaying the contents of the window when fullscreened; I’ve attached the
modified program. (screenshot.png is a 1280x768 game screenshot; if you
want to test the attached code, you can use any image of that size.)

Sik – You are correct, I am running the Unity desktop. I try to test on
stock Ubuntu as much as possible, since that’s what Steam officially
supports. And you also seem to be correct that Unity causes many problems
with fullscreen. In this case, though, the program still does not work in
the GNOME 3 fallback shell.

Is anyone else able to get working Linux fullscreen with this code or some
other code?

Thanks,
Keith Holman
ZachtronicsOn Tue, Aug 13, 2013 at 11:04 PM, Terry Welsh wrote:

Hi Keith,
Here’s a sample program I just stripped out from something slightly
larger. This works fine for me on Ubuntu 12.04. Press alt-enter to toggle
fullscreen.

Terry Welsh
www.reallyslick.com

Is there any documentation or sample code for implementing fullscreen SDL2
programs on Linux? I cannot get either hardware or windowed fullscreen to
work on my machine (running Ubuntu 13.04). I also tried using the SDL
Renderer-based method described at
http://wiki.libsdl.org/moin.fcg/MigrationGuide, but that did not work
either.

There is a huge amount of discussion online around how to implement SDL2
fullscreen on Linux, but I can’t find any description of a working
solution.

If someone can point me to a working example, that would be ideal. Thanks!

Keith Holman
Zachtronics


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

-------------- next part --------------
A non-text attachment was scrubbed…
Name: main3.c
Type: text/x-csrc
Size: 2447 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130815/a2979635/attachment-0001.c

Does testrendercopyex from the test folder work for you with --fullscreen
or --fullscreen-desktop ?

2013/8/15 Keith Holman > Thanks for the sample code, but it does not work for me on 13.04. When I

toggle it into fullscreen, the window either minimizes or disappears
completely, and the program becomes unresponsive. I slightly modified your
sample program to render something so that I could be sure it was
displaying the contents of the window when fullscreened; I’ve attached the
modified program. (screenshot.png is a 1280x768 game screenshot; if you
want to test the attached code, you can use any image of that size.)

Sik – You are correct, I am running the Unity desktop. I try to test on
stock Ubuntu as much as possible, since that’s what Steam officially
supports. And you also seem to be correct that Unity causes many problems
with fullscreen. In this case, though, the program still does not work in
the GNOME 3 fallback shell.

Is anyone else able to get working Linux fullscreen with this code or some
other code?

Thanks,
Keith Holman
Zachtronics

On Tue, Aug 13, 2013 at 11:04 PM, Terry Welsh wrote:

Hi Keith,
Here’s a sample program I just stripped out from something slightly
larger. This works fine for me on Ubuntu 12.04. Press alt-enter to toggle
fullscreen.

Terry Welsh
www.reallyslick.com

Is there any documentation or sample code for implementing fullscreen
SDL2
programs on Linux? I cannot get either hardware or windowed fullscreen to
work on my machine (running Ubuntu 13.04). I also tried using the SDL
Renderer-based method described at
http://wiki.libsdl.org/moin.fcg/MigrationGuide, but that did not work
either.

There is a huge amount of discussion online around how to implement SDL2
fullscreen on Linux, but I can’t find any description of a working
solution.

If someone can point me to a working example, that would be ideal.
Thanks!

Keith Holman
Zachtronics


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


Gabriel.

Weird. It works for me in Unity, KDE, and Xfce on 12.04. Your symptom
of the minimizing or vanishing window sounds exactly like the problems
I was having trying to run a 32-bit app on 64-bit Linux. Gabriel
figured out I didn’t have 32-bit xrandr installed. Here’s that
thread: http://lists.libsdl.org/pipermail/sdl-libsdl.org/2013-July/089572.html--
Terry Welsh
www.reallyslick.com

Message: 5
Date: Thu, 15 Aug 2013 10:26:49 -0700
From: Keith Holman
To: SDL Development List
Subject: Re: [SDL] Documentation of fullscreen on Linux?
Message-ID:
<CANNv706_cVxWc825Jw-imQkDQxaCrdiiymSz3KtjgSyoTZ0JvA at mail.gmail.com>
Content-Type: text/plain; charset=“iso-8859-1”

Thanks for the sample code, but it does not work for me on 13.04. When I
toggle it into fullscreen, the window either minimizes or disappears
completely, and the program becomes unresponsive. I slightly modified your
sample program to render something so that I could be sure it was
displaying the contents of the window when fullscreened; I’ve attached the
modified program. (screenshot.png is a 1280x768 game screenshot; if you
want to test the attached code, you can use any image of that size.)

Sik – You are correct, I am running the Unity desktop. I try to test on
stock Ubuntu as much as possible, since that’s what Steam officially
supports. And you also seem to be correct that Unity causes many problems
with fullscreen. In this case, though, the program still does not work in
the GNOME 3 fallback shell.

Is anyone else able to get working Linux fullscreen with this code or some
other code?

Thanks,
Keith Holman
Zachtronics

Interesting! Both --fullscreen and --fullscreen-desktop work for
testrendercopyex. However, if I start in windowed mode and try to switch
modes (with Ctrl+Enter and Alt+Enter) I see the same symptoms as before.
(The window minimizes or disappears.)

I will take a look at the test_common code to see how it configures
fullscreen mode; I would prefer to be able to switch between fullscreen and
windowed mode like on Windows, but just being able to start up in
fullscreen is good enough. Let me know if you want me to test anything else.

In the worst case you could just destroy the window and create a new
one (though this will mean recreating all video resources manually,
which sucks).

2013/8/15, Keith Holman :> Interesting! Both --fullscreen and --fullscreen-desktop work for

testrendercopyex. However, if I start in windowed mode and try to switch
modes (with Ctrl+Enter and Alt+Enter) I see the same symptoms as before.
(The window minimizes or disappears.)

I will take a look at the test_common code to see how it configures
fullscreen mode; I would prefer to be able to switch between fullscreen and
windowed mode like on Windows, but just being able to start up in
fullscreen is good enough. Let me know if you want me to test anything
else.

Terry, using the SDL_VIDEO_X11_LEGACY_FULLSCREEN=0 environment variable, as
mentioned in that thread, completely solves all the problems in both the
SDL test programs and my program. Thanks! I am using a 64-bit version of
Ubuntu, so the 32/64-bit Xrandr issue definitely could be the problem here.On Thu, Aug 15, 2013 at 11:40 AM, Sik the hedgehog < sik.the.hedgehog at gmail.com> wrote:

In the worst case you could just destroy the window and create a new
one (though this will mean recreating all video resources manually,
which sucks).

2013/8/15, Keith Holman <@Keith_Holman>:

Interesting! Both --fullscreen and --fullscreen-desktop work for
testrendercopyex. However, if I start in windowed mode and try to switch
modes (with Ctrl+Enter and Alt+Enter) I see the same symptoms as before.
(The window minimizes or disappears.)

I will take a look at the test_common code to see how it configures
fullscreen mode; I would prefer to be able to switch between fullscreen
and
windowed mode like on Windows, but just being able to start up in
fullscreen is good enough. Let me know if you want me to test anything
else.


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

try this and rebuild afterwards:

sudo apt-get build-dep libsdl1.2On Thu, Aug 15, 2013 at 4:18 PM, Keith Holman wrote:

Terry, using the SDL_VIDEO_X11_LEGACY_FULLSCREEN=0 environment variable,
as mentioned in that thread, completely solves all the problems in both the
SDL test programs and my program. Thanks! I am using a 64-bit version of
Ubuntu, so the 32/64-bit Xrandr issue definitely could be the problem here.

On Thu, Aug 15, 2013 at 11:40 AM, Sik the hedgehog < sik.the.hedgehog at gmail.com> wrote:

In the worst case you could just destroy the window and create a new
one (though this will mean recreating all video resources manually,
which sucks).

2013/8/15, Keith Holman :

Interesting! Both --fullscreen and --fullscreen-desktop work for
testrendercopyex. However, if I start in windowed mode and try to switch
modes (with Ctrl+Enter and Alt+Enter) I see the same symptoms as before.
(The window minimizes or disappears.)

I will take a look at the test_common code to see how it configures
fullscreen mode; I would prefer to be able to switch between fullscreen
and
windowed mode like on Windows, but just being able to start up in
fullscreen is good enough. Let me know if you want me to test anything
else.


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

Anthony – I ran that, rebuilt SDL, and ran my test program and SDL’s
testrendercopyex. Both behave the same way as before I installed the build
deps. (That is, fullscreen works if I disable
SDL_VIDEO_X11_LEGACY_FULLSCREEN, and does not otherwise.)

What was running that command supposed to do?On Thu, Aug 15, 2013 at 2:05 PM, Anthony Walter wrote:

try this and rebuild afterwards:

sudo apt-get build-dep libsdl1.2

On Thu, Aug 15, 2013 at 4:18 PM, Keith Holman <@Keith_Holman>wrote:

Terry, using the SDL_VIDEO_X11_LEGACY_FULLSCREEN=0 environment variable,
as mentioned in that thread, completely solves all the problems in both the
SDL test programs and my program. Thanks! I am using a 64-bit version of
Ubuntu, so the 32/64-bit Xrandr issue definitely could be the problem here.

On Thu, Aug 15, 2013 at 11:40 AM, Sik the hedgehog < sik.the.hedgehog at gmail.com> wrote:

In the worst case you could just destroy the window and create a new
one (though this will mean recreating all video resources manually,
which sucks).

2013/8/15, Keith Holman <@Keith_Holman>:

Interesting! Both --fullscreen and --fullscreen-desktop work for
testrendercopyex. However, if I start in windowed mode and try to
switch
modes (with Ctrl+Enter and Alt+Enter) I see the same symptoms as
before.
(The window minimizes or disappears.)

I will take a look at the test_common code to see how it configures
fullscreen mode; I would prefer to be able to switch between
fullscreen and
windowed mode like on Windows, but just being able to start up in
fullscreen is good enough. Let me know if you want me to test anything
else.


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


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

2013/8/15 Keith Holman

Anthony – I ran that, rebuilt SDL, and ran my test program and SDL’s
testrendercopyex. Both behave the same way as before I installed the build
deps. (That is, fullscreen works if I disable
SDL_VIDEO_X11_LEGACY_FULLSCREEN, and does not otherwise.)

What was running that command supposed to do?

Did you read this as Terry recommended?
http://forums.libsdl.org/viewtopic.php?p=38549#38549

I did read that, which led me to try SDL_VIDEO_X11_LEGACY_FULLSCREEN=0.
Your link seems to contain more of the conversation, though, including the
suggestion to install 32-bit XRandR libraries. I installed those
packages (libxrandr2:i386
and libxinerama1:i386), but it had no effect on the behavior of my test
program; the window still permanently minimizes when I try to go fullscreen.

Thanks,
Keith HolmanOn Thu, Aug 15, 2013 at 4:36 PM, Gabriel Jacobo wrote:

2013/8/15 Keith Holman <@Keith_Holman>

Anthony – I ran that, rebuilt SDL, and ran my test program and SDL’s
testrendercopyex. Both behave the same way as before I installed the build
deps. (That is, fullscreen works if I disable
SDL_VIDEO_X11_LEGACY_FULLSCREEN, and does not otherwise.)

What was running that command supposed to do?

Did you read this as Terry recommended?
http://forums.libsdl.org/viewtopic.php?p=38549#38549


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

My case was a little different; I only needed the 32-bit xrandr lib
because I was compiling on 32-bit and running on 64-bit. I’m guessing
you’re compiling and running on the same computer.

The decision to use the legacy code path is made in
X11_SetWindowFullscreen() in SDL_x11window.c. You’ll probably need to
trace through the code and figure out why your system is choosing
legacy.

As a side note, my system worked fine with the non-legacy code path
even without xrandr installed. And you seem to be doing fine forcing
the non-legacy code path as well. So the logic that decides to use the
legacy path probably needs to be revisited. Also, legacy doesn’t seem
to be working for anyone when it gets used.–
Terry Welsh
www.reallyslick.com

I did read that, which led me to try SDL_VIDEO_X11_LEGACY_FULLSCREEN=0.
Your link seems to contain more of the conversation, though, including the
suggestion to install 32-bit XRandR libraries. I installed those
packages (libxrandr2:i386
and libxinerama1:i386), but it had no effect on the behavior of my test
program; the window still permanently minimizes when I try to go fullscreen.

Thanks,
Keith Holman