| Summary: | [Patch] Mac: update some internal code to use modern codepaths rather than deprecated functionality, when available | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Alex Szpakowski <amaranth72> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | minor | ||
| Priority: | P2 | CC: | icculus |
| Version: | HG 2.0 | Keywords: | triage-2.0.4 |
| Hardware: | x86_64 | ||
| OS: | Mac OS X (All) | ||
| Attachments: |
Patch to use some modern Mac APIs rather than deprecated ones, when available
Patch to use some modern Mac APIs rather than deprecated ones, when available Patch to prefer some modern Mac APIs over deprecated ones (v3) Patch to prefer some modern Mac APIs over deprecated ones (v4) |
||
Created attachment 2008 [details]
Patch to use some modern Mac APIs rather than deprecated ones, when available
(In reply to Alex Szpakowski from comment #1) > Created attachment 2008 [details] > Patch to use some modern Mac APIs rather than deprecated ones, when available Notes: - Cocoa_ShouldUseIdleIOPMAssertion() should just be checked once at init time and stored as a BOOL somewhere under _this. Not that it's a real expensive function or anything, of course. - Put a FIXME or something on this: CFSTR("SDL-based app running") ... eventually I'd like to add a simple app metadata API that lets an app describe some basic things about itself, since there are a few places on various platforms where we end up saying "SDL application" instead of "Super Mario Bros." - Does the legacy path not need to call SetFrontProcess()? That got removed in the patch. --ryan. (In reply to Ryan C. Gordon from comment #2) > - Put a FIXME or something on this: CFSTR("SDL-based app running") ... > eventually I'd like to add a simple app metadata API that lets an app > describe some basic things about itself, since there are a few places on > various platforms where we end up saying "SDL application" instead of "Super > Mario Bros." Should I just make it use the actual application name? SDL_cocoaevents.m already has a function to determine it, since it creates the menubar items programmatically. (In reply to Ryan C. Gordon from comment #2) > - Does the legacy path not need to call SetFrontProcess()? That got removed > in the patch. > > --ryan. The patch replaces the SetFrontProcess call with [NSApp activateIgnoringOtherApps:YES] (the Cocoa version of that Carbon function.) (In reply to Alex Szpakowski from comment #3) > Should I just make it use the actual application name? SDL_cocoaevents.m > already has a function to determine it, since it creates the menubar items > programmatically. Actually the Apple documentation says this, so I guess the app name isn't quite appropriate: > specify a CFString like "Checking mail" or "Compiling" that describes the task that this assertion protects. Created attachment 2013 [details]
Patch to prefer some modern Mac APIs over deprecated ones (v3)
Created attachment 2014 [details]
Patch to prefer some modern Mac APIs over deprecated ones (v4)
I updated the name used in IOPMAssertionCreate to include the application name, and added a comment about it.
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though! This looks good to me; it's now https://hg.libsdl.org/SDL/rev/ad9d35983de5, thanks! --ryan. |
Created attachment 2007 [details] Patch to use some modern Mac APIs rather than deprecated ones, when available SDL's Mac code for preventing the screensaver from activating and for making the app show up in the Dock is using long-deprecated APIs. I have attached a patch to use more modern APIs when available.