[SDL2]Strange behavior when switching from windowed to fullscreen

Hello everyone,

I’m not sure if this is intended or I’m misusing anything, but when I try
to switch to fullscreen just after setting up the window and the renderer,
I get a nice fullscreen window with the right scaling. If I switch to
windowed mode and thereafter to fullscreen again, a non-scaled drawing
region appears aligned to the center of the window. Again, by setting the
window size(to the same values as before), the same pattern repeats. Over
and over.

The window is created with 1024x768 and my desktop resolution is 1366x768.

Here’s my initialization code:


I’m on Ubuntu 12.04 LTS x64 using Unity 5.18.0.

Do I need to set the logical viewport after resizingswitching to fullscreen
the window? The documentation says that the aspect ratio must be the same
after resizing, otherwise the aforementioned centering will occur.

Thanks for your time,