Switching from fullscreen to desktop_fullscreen broken

While porting an old SDL1.2 application to SDL2, I ran into some trouble
with fullscreen mode. Using the code from SDL_test_common.c as a guide I’ve
got most of it figured out, however there is one issue that remains: when
switching from fullscreen to desktop fullscreen mode, only the top left
quarter of the window is rendered correctly, the rest remains black.

I can reproduce the behavior when running testdraw2 --fullscreen, then
pressing Shift+Enter to switch to desktop fullscreen mode.

This is with SDL rev. 7cbfd97f1430 on Ubuntu 16.04 with standard X11/Unity
desktop and the binary nvidia drivers (361.42).

The thing is, it can be made to behave correctly by executing the following
sequence:
testdraw2 --fullscreen
Shift+Enter (now it’s fullscreen desktop, but broken)
Alt+Enter (now it’s in window mode, correctly)
Shift+Enter (now it’s fullscreen desktop, correctly)
And from now on, repeated Shift+Enter correctly toggles fullscreen and
fullscreen desktop

My own application behaves pretty much the same as the SDL test program. I
tried a couple of things as workaround, but to no avail. I did notice that
minimizing and then maximizing the window once it is in fullscreen desktop
mode with the issue present will also fix it. However, calling
SDL_MinimizeWindow followed by SDL_MaximizeWindow will leave the window
minimized and I have to manually click the icon in the launcher to restore
it. This might be a separate issue.

Should I open a bug report for the mode switching issue? Any additional
information that might help getting this resolved?

Now that my own code changes are nearly done, I’ll be testing with some
different systems as well. Will report my findings here, if there is
difference in behavior.

Kai

Hi,
Filing a bug sounds good.
Do you get a 640x480 video mode when you launch “testdraw2 --fullscreen”?

I tried reproducing this on a similar system: older macbook with 1280x800
screen, Ubuntu 16.04, nvidia driver 340.96, SDL rev 7cbfd97f1430.
On my system when I launch “testdraw2 --fullscreen”, I get a message:
"Window requested size 640x480, got 1280x800"
and I get a fullscreen window at my desktop resolution, 1280x800.
Shift+Enter doesn’t have any visible effect, but I guess it works, and
Alt+Enter returns to windowed mode properly.

When I launch without --fullscreen, Ctrl+Enter fails to enter fullscreen
mode (the screen flashes, but the demo app stays windowed.)
Not sure if this helps much, but I guess it gives another data point.
Cheers,
EricOn Sat, Jun 4, 2016 at 2:22 PM, Kai Sterker <kai.sterker at gmail.com> wrote:

While porting an old SDL1.2 application to SDL2, I ran into some trouble
with fullscreen mode. Using the code from SDL_test_common.c as a guide I’ve
got most of it figured out, however there is one issue that remains: when
switching from fullscreen to desktop fullscreen mode, only the top left
quarter of the window is rendered correctly, the rest remains black.

I can reproduce the behavior when running testdraw2 --fullscreen, then
pressing Shift+Enter to switch to desktop fullscreen mode.

This is with SDL rev. 7cbfd97f1430 on Ubuntu 16.04 with standard X11/Unity
desktop and the binary nvidia drivers (361.42).

The thing is, it can be made to behave correctly by executing the
following sequence:
testdraw2 --fullscreen
Shift+Enter (now it’s fullscreen desktop, but broken)
Alt+Enter (now it’s in window mode, correctly)
Shift+Enter (now it’s fullscreen desktop, correctly)
And from now on, repeated Shift+Enter correctly toggles fullscreen and
fullscreen desktop

My own application behaves pretty much the same as the SDL test program. I
tried a couple of things as workaround, but to no avail. I did notice that
minimizing and then maximizing the window once it is in fullscreen desktop
mode with the issue present will also fix it. However, calling
SDL_MinimizeWindow followed by SDL_MaximizeWindow will leave the window
minimized and I have to manually click the icon in the launcher to restore
it. This might be a separate issue.

Should I open a bug report for the mode switching issue? Any additional
information that might help getting this resolved?

Now that my own code changes are nearly done, I’ll be testing with some
different systems as well. Will report my findings here, if there is
difference in behavior.

Kai


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

On Tue, Jun 7, 2016 at 5:54 AM, Eric Wasylishen

Filing a bug sounds good.

Will do that. Already checked the open bugs, but found none that came close
to my issue.

Do you get a 640x480 video mode when you launch “testdraw2 --fullscreen”?

Yes. I do get a proper video mode change to 640x480. On switching to
fullscreen desktop afterwards, it also correctly changes the resolution to
1280x1024, and renders at correct size. However, the render output appears
to be clipped to a 640x480 rectangle in the top left corner.

From testing with my own application, I can tell that
SDL_GetRendererOutputSize reports the expected values, and calling either
of SDL_RenderSetClipRect or SDL_RenderSetViewport with a NULL rect did not
make any difference.

I can also reproduce the exact same behaviour on Ubuntu 14.04, when using
the aforementioned SDL revision.

Kai

On Tue, Jun 7, 2016 at 5:54 AM, Eric Wasylishen

Filing a bug sounds good.

Will do that. Already checked the open bugs, but found none that came
close to my issue.

Finally got around to it: https://bugzilla.libsdl.org/show_bug.cgi?id=3357

KaiOn Tue, Jun 7, 2016 at 10:09 AM, Kai Sterker <@Kai_Sterker> wrote: