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