diff options
author | Kevin Walzer <kw@codebykevin.com> | 2015-11-25 03:19:19 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2015-11-25 03:19:19 (GMT) |
commit | 44411926e57b5c15f9910dcdcde14c666571645e (patch) | |
tree | 675f04c49d176dbe08d0c67bcb1757316f1ad1a9 /macosx/tkMacOSXWindowEvent.c | |
parent | 52d9e935fa49fe13831f9e0eddba4e260c88f0f0 (diff) | |
download | tk-44411926e57b5c15f9910dcdcde14c666571645e.zip tk-44411926e57b5c15f9910dcdcde14c666571645e.tar.gz tk-44411926e57b5c15f9910dcdcde14c666571645e.tar.bz2 |
Remove multiple deprecated internal API calls on OS X; streamline Apple Events implementation; thanks to Marc Culler for extensive patches
Diffstat (limited to 'macosx/tkMacOSXWindowEvent.c')
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index c028a75..0b32e7e 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -747,15 +747,16 @@ TkWmProtocolEventProc( int Tk_MacOSXIsAppInFront(void) { - OSStatus err; - ProcessSerialNumber frontPsn, ourPsn = {0, kCurrentProcess}; Boolean isFrontProcess = true; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + ProcessSerialNumber frontPsn, ourPsn = {0, kCurrentProcess}; - err = ChkErr(GetFrontProcess, &frontPsn); - if (err == noErr) { - ChkErr(SameProcess, &frontPsn, &ourPsn, &isFrontProcess); + if (noErr == GetFrontProcess(&frontPsn)){ + SameProcess(&frontPsn, &ourPsn, &isFrontProcess); } - +#else + isFrontProcess = [NSRunningApplication currentApplication].active; +#endif return (isFrontProcess == true); } |