Remove Carbon API usage.

The new API has been available since 10.6 or 10.7 and the debugger
indicates it simply calls through to TransformProcessType.

Change-Id: Ia8f82d7426cb409aca8fd5feb8e43e1b0e79f8f6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
Jake Petroules 2015-11-27 02:18:23 -08:00
parent 105fc117b7
commit 32eeb46f3c

View File

@ -443,12 +443,10 @@ Qt::DropActions qt_mac_mapNSDragOperations(NSDragOperation nsActions)
// Misc // Misc
// //
// Changes the process type for this process to kProcessTransformToForegroundApplication, // Sets the activation policy for this process to NSApplicationActivationPolicyRegular,
// unless either LSUIElement or LSBackgroundOnly is set in the Info.plist. // unless either LSUIElement or LSBackgroundOnly is set in the Info.plist.
void qt_mac_transformProccessToForegroundApplication() void qt_mac_transformProccessToForegroundApplication()
{ {
ProcessSerialNumber psn;
if (GetCurrentProcess(&psn) == noErr) {
bool forceTransform = true; bool forceTransform = true;
CFTypeRef value = CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), CFTypeRef value = CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(),
CFSTR("LSUIElement")); CFSTR("LSUIElement"));
@ -485,8 +483,7 @@ void qt_mac_transformProccessToForegroundApplication()
} }
if (forceTransform) { if (forceTransform) {
TransformProcessType(&psn, kProcessTransformToForegroundApplication); [[NSApplication sharedApplication] setActivationPolicy:NSApplicationActivationPolicyRegular];
}
} }
} }
static CGColorSpaceRef m_genericColorSpace = 0; static CGColorSpaceRef m_genericColorSpace = 0;