Index: /branches/ide-1.0/ccl/examples/cocoa-window.lisp
===================================================================
--- /branches/ide-1.0/ccl/examples/cocoa-window.lisp	(revision 6685)
+++ /branches/ide-1.0/ccl/examples/cocoa-window.lisp	(revision 6686)
@@ -61,5 +61,5 @@
 		 :void))
 
-(defvar *appkit-process-interrupt-ids* (make-id-map))
+(defstatic *appkit-process-interrupt-ids* (make-id-map))
 (defun register-appkit-process-interrupt (thunk)
   (assign-id-map-id *appkit-process-interrupt-ids* thunk))
@@ -112,30 +112,36 @@
 (defparameter *debug-in-event-process* t)
 
+(defparameter *event-process-reported-conditions* () "Things that we've already complained about on this event cycle.")
+
 (defmethod process-debug-condition ((process appkit-process) condition frame-pointer)
   "Better than nothing.  Not much better."
   (when *debug-in-event-process*
-    (catch 'need-a-catch-frame-for-backtrace
-      (let* ((*debug-in-event-process* nil)
-             (context (new-backtrace-info nil
-                                          frame-pointer
-                                          (if *backtrace-contexts*
-                                            (or (child-frame
-                                                 (bt.youngest (car *backtrace-contexts*))
-                                                 nil)
+    (let* ((c (if (typep condition 'ns-lisp-exception)
+                (ns-lisp-exception-condition condition)
+                condition)))
+      (unless (member c *event-process-reported-conditions*)
+        (catch 'need-a-catch-frame-for-backtrace
+          (let* ((*debug-in-event-process* nil)
+                 (context (new-backtrace-info nil
+                                              frame-pointer
+                                              (if *backtrace-contexts*
+                                                (or (child-frame
+                                                     (bt.youngest (car *backtrace-contexts*))
+                                                     nil)
+                                                    (last-frame-ptr))
                                                 (last-frame-ptr))
-                                            (last-frame-ptr))
-                                          (%current-tcr)
-                                          condition
-                                          (%current-frame-ptr)
-                                          #+ppc-target *fake-stack-frames*
-                                          #+x86-target (%current-frame-ptr)
-                                          (db-link)
-                                          (1+ *break-level*)))
-             (*backtrace-contexts* (cons context *backtrace-contexts*)))  
-        (format t "~%~%*** Error in event process: ~a~%~%" condition)
-        (print-call-history :context context :detailed-p t :count 20 :origin frame-pointer)
-        (format t "~%~%~%")
-        (force-output t)
-        ))))
+                                              (%current-tcr)
+                                              condition
+                                              (%current-frame-ptr)
+                                              #+ppc-target *fake-stack-frames*
+                                              #+x86-target (%current-frame-ptr)
+                                              (db-link)
+                                              (1+ *break-level*)))
+                 (*backtrace-contexts* (cons context *backtrace-contexts*)))  
+            (format t "~%~%*** Error in event process: ~a~%~%" condition)
+            (print-call-history :context context :detailed-p t :count 20 :origin frame-pointer)
+            (format t "~%~%~%")
+            (force-output t)
+            ))))))
 
 
@@ -186,5 +192,6 @@
   (let* ((app *NSApp*))
     (loop
-	(handler-case (#/run app)
+	(handler-case (let* ((*event-process-reported-conditions* nil))
+                        (#/run app))
 	  (error (c) (nslog-condition c)))
 	(unless (#/isRunning app)
