You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: HG 2.0 Reported for operating system, platform: macOS 10.12, x86_64
Comments on the original bug report:
On 2017-09-02 20:40:31 +0000, David Ludwig wrote:
Created attachment 2906
code for sample application (to reproduce bug with)
On macOS/OSX, toggling between fullscreen and windowed mode via SDL_SetWindowFullscreen calls can cause an app that uses a 'logical screen size', as set via SDL_RenderSetLogicalSize, to not display content correctly.
This bug was -not- present in SDL 2.0.5, but is present in the latest from hg.libsdl.org as of this writing (https://hg.libsdl.org/SDL/rev/11413fa29401). I am not sure which commit triggered this.
Steps to reproduce:
create an SDL_Window in windowed mode
create an SDL_Renderer, using SDL provided defaults
set the SDL_Renderer's logical size to that of the window's size
create and populate a texture, whose size equals that of the SDL_Window, and the SDL_Renderer's logical size
create a game loop, processing events, and displaying the texture in its entirety
add a means to toggle between fullscreen and windowed mode, via calls to SDL_SetWindowFullscreen
run the app
switch to fullscreen, via a call to SDL_SetWindowFullscreen. If using the attached sample code, press 'F' to switch to fullscreen.
switch to windowed mode, via a call to SDL_SetWindowFullscreen. If using the attached sample code, press 'W' to switch to windowed-mode.
observe the contents of the window
Expected result: the entire texture's contents are displayed
Observed result: only a portion of the texture is displayed
Side-observation: the window's position will change, when going back to windowed mode. This was not expected, and may warrant a separate bugzilla case and/or fix
A sample program is attached, with keyboard input potentially leading to SDL_SetWindowFullscreen being called. Specifically, pressing:
'F' will switch to fullscreen
'W' will switch to windowed mode
On 2017-09-02 20:41:46 +0000, David Ludwig wrote:
Created attachment 2907
screenshot of expected result, using attached sample code
On 2017-09-02 20:42:52 +0000, David Ludwig wrote:
Created attachment 2908
screenshot of observed result, using attached sample code
Here is a possible fix for this bug. In my own testing (on macOS 10.12), it does not reintroduce the bug (# 3719, https://bugzilla.libsdl.org/show_bug.cgi?id=3719) that changeset 11421 fixed. It also fixes the reopened bug 3719's issue, whereby the SDL window can unexpectedly move, after switching from fullscreen to windowed mode.
Changeset 11421 does not invoke the SDL_Renderer's viewport-updating routines, due in part to [Cocoa_WindowListener windowDidResize:] ceasing to be called (via change 11421).
This change re-introduces the manual call to [Cocoa_WindowListener windowDidResize:], which updates the renderer's viewport, and leaves the window in the expected position.
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: HG 2.0
Reported for operating system, platform: macOS 10.12, x86_64
Comments on the original bug report:
On 2017-09-02 20:40:31 +0000, David Ludwig wrote:
On 2017-09-02 20:41:46 +0000, David Ludwig wrote:
On 2017-09-02 20:42:52 +0000, David Ludwig wrote:
On 2017-09-02 20:59:41 +0000, David Ludwig wrote:
On 2017-09-03 21:41:47 +0000, David Ludwig wrote:
On 2017-09-04 18:31:25 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: