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 2656

Summary: [Patch] Mac: send shown/hidden window events when window occlusion state changes
Product: SDL Reporter: Alex Szpakowski <amaranth72>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED ABANDONED QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2 CC: sdlbug
Version: HG 2.0   
Hardware: x86   
OS: Mac OS X 10.8   
Attachments: Patch to make SDL post the appropriate events when the occlusion state of a window changes
Updated patch to post window visibility events when occlusion state changes

Description Alex Szpakowski 2014-07-20 02:45:00 UTC
Created attachment 1778 [details]
Patch to make SDL post the appropriate events when the occlusion state of a window changes

Mac OS 10.9 added a window notification for when the occlusion state of a window (whether it's fully covered by other opaque windows) changes. Making good use of it can help save CPU/energy/power/heat usage.

I have attached a patch which makes SDL post SDL_WINDOWEVENT_SHOWN and SDL_WINDOWEVENT_HIDDEN window events when the occlusion state of the window changes in 10.9+.
Comment 1 Alex Szpakowski 2014-07-29 19:01:47 UTC
Created attachment 1792 [details]
Updated patch to post window visibility events when occlusion state changes

My previous patch missed the case where it should remove the occlusion state notification observer when the Cocoa_WindowListener is closed. I've attached an updated patch which handles that situation.
Comment 2 Alex Szpakowski 2014-07-29 22:50:43 UTC
Actually this has some really nasty side-effects when FULLSCREEN_DESKTOP mode is used (related to SDL_OnWindowShown and SDL_OnWindowHidden calling SDL_UpdateFullscreenMode), so this patch shouldn't be applied until I sort those issues out...
Comment 3 Ryan C. Gordon 2018-08-06 21:20:22 UTC
Hello, and sorry if you're getting dozens of copies of this message by email.

We are closing out bugs that appear to be abandoned in some form. This can happen for lots of reasons: we couldn't reproduce it, conversation faded out, the bug was noted as fixed in a comment but we forgot to mark it resolved, the report is good but the fix is impractical, we fixed it a long time ago without realizing there was an associated report, etc.

Individually, any of these bugs might have a better resolution (such as WONTFIX or WORKSFORME or INVALID) but we've added a new resolution of ABANDONED to make this easily searchable and make it clear that it's not necessarily unreasonable to revive a given bug report.

So if this bug is still a going concern and you feel it should still be open: please feel free to reopen it! But unless you respond, we'd like to consider these bugs closed, as many of them are several years old and overwhelming our ability to prioritize recent issues.

(please note that hundred of bug reports were sorted through here, so we apologize for any human error. Just reopen the bug in that case!)

Thanks,
--ryan.