Index: /trunk/ccl/examples/cocoa-window.lisp
===================================================================
--- /trunk/ccl/examples/cocoa-window.lisp	(revision 540)
+++ /trunk/ccl/examples/cocoa-window.lisp	(revision 541)
@@ -63,4 +63,15 @@
 
 (defconstant process-interrupt-event-subtype 17)
+
+
+
+
+(defclass lisp-application (ns:ns-application)
+    ((termp :foreign-type :<BOOL>))
+  (:metaclass ns:+ns-object))
+
+
+(define-objc-method ((:void :post-event-at-start e) ns:ns-application)
+  (send self :post-event e :at-start t))
 
 ;;; Interrupt the AppKit event process, by enqueing an event (if the
@@ -88,12 +99,9 @@
 		      :data2 0)))
 	(send e 'retain)
-	(send *NSApp* :post-event e :at-start t)))))
-
-
-(defclass lisp-application (ns:ns-application)
-    ((termp :foreign-type :<BOOL>))
-  (:metaclass ns:+ns-object))
-
-
+	(send *NSApp*
+	      :perform-selector-on-main-thread (@selector
+						"postEventAtStart:")
+	      :with-object e
+	      :wait-until-done t)))))
 
 #+apple-objc
