SDL_SetWindowFullscreen fails to switch to windowed

Hi!
I’m using SDL2.0.3, Mac OS X 10.8.5. I got that code:

Code:
SDL_SetWindowFullscreen(window, fullscreen ? SDL_WINDOW_FULLSCREEN : 0);

It works great when I switch from windowed to fullscreen but nothing happens when I try to go back to windowed mode. SDL_SetWindowFullscreen is always returning 0 so I have no idea what is wrong. I need some advice what should I do. Btw when I use SDL_WINDOW_FULLSCREEN_DESKTOP strange things happen… I got just small window (1024x768 is which I’m using) in the left bottom corner of screen and the rest of screen is black (the other monitor is also black).

What does the output of SDL_GetError contain after making the call?On 2014/03/ 27, at 11:18, ElChupacabra wrote:

Hi!
I’m using SDL2.0.3, Mac OS X 10.8.5. I got that code:

Code:
SDL_SetWindowFullscreen(window, fullscreen ? SDL_WINDOW_FULLSCREEN : 0);

It works great when I switch from windowed to fullscreen but nothing happens when I try to go back to windowed mode. SDL_SetWindowFullscreen is always returning 0 so I have no idea what is wrong. I need some advice what should I do. Btw when I use SDL_WINDOW_FULLSCREEN_DESKTOP strange things happen… I got just small window (1024x768 is which I’m using) in the left bottom corner of screen and the rest of screen is black (the other monitor is also black).


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

Cheers,
Jeffrey Carpenter
<@Jeffrey_Carpenter>

I recently updated my engine to use latest SDL2-2.0.3 and I can
confirm that this isn’t working. I did test this on Mac OSX Mavericks
(10.9.2).

This can be tested in any of the test programs included with SDL2.

Fire up ‘testsprite2’ for example and toggleFullscreen using ‘CTRL +
Enter’. Window -> Fullscreen works fine but not Fullscreen ->
windowed.

However, when toggling using ‘ALT + Enter’ it works fine. This mode
uses ‘SDL_WINDOW_FULLSCREEN_DESKTOP’.

‘CTRL + Enter’ uses ‘SDL_WINDOW_FULLSCREEN’ mode.

Any Mac guru know what might cause this behavior?On Thu, Mar 27, 2014 at 04:18:41PM +0000, ElChupacabra wrote:

Hi!
I’m using SDL2.0.3, Mac OS X 10.8.5. I got that code:

Code:
SDL_SetWindowFullscreen(window, fullscreen ? SDL_WINDOW_FULLSCREEN : 0);

It works great when I switch from windowed to fullscreen but nothing
happens when I try to go back to windowed
mode. SDL_SetWindowFullscreen is always returning 0 so I have no
idea what is wrong. I need some advice what should I do. Btw when I
use SDL_WINDOW_FULLSCREEN_DESKTOP strange things happen… I got
just small window (1024x768 is which I’m using) in the left bottom
corner of screen and the rest of screen is black (the other monitor
is also black).


Regards,
Andreas

I can confirm this bug report as well, using SDL v2.0.3’s test/testsprite2 on Mac OS X 10.9.2. I strongly suspect that this is a bug of some sort introduced in either 2.0.2 or 2.0.3.

I took a short look at src/video/cocoa/SDL_cocoawindow.m – where some (all? I don’t know!) of the recent changes have occurred with fullscreen toggles, but it all looks like greek to me, with nothing obvious jumping out at me. (Not surprisingly, I don’t know anything about Cocoa’s API).

One of you two care to file a bug report? :slight_smile:

Cheers,
Jeffrey Carpenter
<@Jeffrey_Carpenter>On 2014/04/ 03, at 6:33, Andreas wrote:

On Thu, Mar 27, 2014 at 04:18:41PM +0000, ElChupacabra wrote:

Hi!
I’m using SDL2.0.3, Mac OS X 10.8.5. I got that code:

Code:
SDL_SetWindowFullscreen(window, fullscreen ? SDL_WINDOW_FULLSCREEN : 0);

It works great when I switch from windowed to fullscreen but nothing
happens when I try to go back to windowed
mode. SDL_SetWindowFullscreen is always returning 0 so I have no
idea what is wrong. I need some advice what should I do. Btw when I
use SDL_WINDOW_FULLSCREEN_DESKTOP strange things happen… I got
just small window (1024x768 is which I’m using) in the left bottom
corner of screen and the rest of screen is black (the other monitor
is also black).

I recently updated my engine to use latest SDL2-2.0.3 and I can
confirm that this isn’t working. I did test this on Mac OSX Mavericks
(10.9.2).

This can be tested in any of the test programs included with SDL2.

Fire up ‘testsprite2’ for example and toggleFullscreen using ‘CTRL +
Enter’. Window -> Fullscreen works fine but not Fullscreen ->
windowed.

However, when toggling using ‘ALT + Enter’ it works fine. This mode
uses ‘SDL_WINDOW_FULLSCREEN_DESKTOP’.

‘CTRL + Enter’ uses ‘SDL_WINDOW_FULLSCREEN’ mode.

Any Mac guru know what might cause this behavior?


Regards,
Andreas


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

Just letting you guys know that I went ahead and filed the bug report regarding the discussed issue – https://bugzilla.libsdl.org/show_bug.cgi?id=2479

Cheers,
Jeffrey Carpenter
<@Jeffrey_Carpenter>

Thanks.

I’ll go ahead and create an account on BugZilla too so that I can help
fixing and submitting bugs in the future.

Cheers,On Sat, Apr 05, 2014 at 03:37:56AM -0500, Jeffrey Carpenter wrote:

Just letting you guys know that I went ahead and filed the bug
report regarding the discussed issue –
https://bugzilla.libsdl.org/show_bug.cgi?id=2479


Regards,
Andreas