We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3587

Summary: SDL_RenderFillRect (and others) broken on OS X full screen retina
Product: SDL Reporter: Oliver Collyer <ovcollyer>
Component: renderAssignee: Alex Szpakowski <amaranth72>
Status: WAITING --- QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2    
Version: 2.0.5   
Hardware: x86_64   
OS: macOS 10.12   
Attachments: Test project

Description Oliver Collyer 2017-02-15 11:16:11 UTC
Created attachment 2698 [details]
Test project

Build and run the attached project and it will switch to full screen retina mode. The background will cycle slowly through the primary colours. There is supposed to be a small black rectangle drawn on the screen at position (100,100) but this is not visible.

However, if you remove SDL_WINDOW_ALLOW_HIGH_DPI from the create window call you should see that the black rectangle is then drawn correctly.

The issue only occurs in SDL_WINDOW_FULLSCREEN mode.

SDL_RenderFillRect is just one example of a render call not working - my entire app doesn't work due to this bug, I just created this test project to illustrate it as simply as possible.

I've reproduced this on separate MacBook Pros so it's not my machine. I don't have a non-Sierra Mac to try though, so can't comment on whether it is OS-specific. I've only tried it on SDL 2.0.5.
Comment 1 Oliver Collyer 2017-03-02 12:32:06 UTC
Ok, just an update.

I painstakingly narrowed it down to these two changelists:

https://hg.libsdl.org/SDL/rev/553e9f7cd10e (15th June 2014)
https://hg.libsdl.org/SDL/rev/413b222c4b64 (26th May 2015)

If you revert *both* of these changes in SDL2-2.0.5 source then the bug goes away. Or revert the whole of the code to a snapshot prior to 15th June 2014 (SDL2-2.0.3 era).

I hope that is enough of a hint to whoever is knowledgeable in this area to be able to come up with a fix sometime.

That's not the end of it though, unfortunately as I've found additional issues with (proper) full screen retina that makes it unusable, but I'll open another bug about that.

I know there is a sort of workaround for all of this by using SDL_DESKTOP_FULLSCREEN but the problem with that is you cannot control the refresh rate and in my use-case (a video player) I would like to be able to match the refresh rate to the video framerate for optimum smoothness.
Comment 2 Sam Lantinga 2017-08-11 19:50:04 UTC
Alex, can you look at this regression for the SDL 2.0.6 release?
Comment 3 Alex Szpakowski 2017-08-12 01:03:06 UTC
I've tested this on my retina 15" MBP using the latest SDL from hg, and similarly to bug #3598 I can't reproduce the issue as you've described using your test project. Can you confirm?