[Openmcl-cvs-notifications] r7574 - /trunk/ccl/cocoa-ide/cocoa-window.lisp

gb at clozure.com gb at clozure.com
Wed Oct 31 00:07:08 MDT 2007


Author: gb
Date: Wed Oct 31 02:07:08 2007
New Revision: 7574

Log:
Use documented foreign function calls (only) in ENABLE-FOREGROUND.
Need to double-check to ensure that that all works on PPC/Tiger
as well.

The old mechanism - CPSEnableForeground - was generating deprecation
warnings in /var/log/system.log.  (Along with all of the usual messages
about Xcode memory leaks ...)

Modified:
    trunk/ccl/cocoa-ide/cocoa-window.lisp

Modified: trunk/ccl/cocoa-ide/cocoa-window.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/ccl/cocoa-ide/cocoa-window.lisp (original)
+++ trunk/ccl/cocoa-ide/cocoa-window.lisp Wed Oct 31 02:07:08 2007
@@ -150,12 +150,13 @@
 (defloadvar *default-ns-application-proxy-class-name*
     "LispApplicationDelegate")
 =

+
 #+apple-objc
 (defun enable-foreground ()
-  (%stack-block ((psn 8))
-    (external-call "_GetCurrentProcess" :address psn)
-    (external-call "_CPSEnableForegroundOperation" :address psn)
-    (eql 0 (external-call "_SetFrontProcess" :address psn :signed-halfword=
))))
+  (rlet ((psn :<P>rocess<S>erial<N>umber))
+    (#_GetCurrentProcess psn)
+    (#_TransformProcessType psn #$kProcessTransformToForegroundApplication)
+    (eql 0 (#_SetFrontProcess psn))))
 =

 ;;; I'm not sure if there's another way to recognize events whose
 ;;; type is #$NSApplicationDefined.




More information about the Openmcl-cvs-notifications mailing list