[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem with view-deactivate-event-handler

I tried defining this method on a window I had, so that when it was deactivated
it would go to the back of all of the windows.

(defmethod view-deactivate-event-handler ((window procs-window))
  (set-window-layer window (length (windows)))

Theorectically, this should have worked. Unfortunately, all Lisp did 
upon deactivation of said window was to infinitely recurse calling
view-deactivate-event-handler and die with a stack overflow.

I switched the call-next-method in front of the set-window-layer command, 
thinking that call-next-method tried something funny with the placement of
the windows, and that I could do my call after it. No dice.

I finally had to resort to 
(defmethod view-deactivate-event-handler ((window procs-window))
  (when (eql (front-window) window)	
     (set-window-layer window (length (windows))))

which worked. It circumvented the recursion. But, hey! What gives with this
bizarre crash causing bug?

Also, after this I tried to change the procedure to not just set the window
to the back, but to set it one behind another particular window. 
(if that window existed on the screen) 
However, that also killed Lisp and caused it to partially deactivate the window,
and then start beeping in clusters of three beeps at a time. I tried to 
abort it, and succeeded but was still in a bad state and had to reboot the 
mac to continue.

Something is up with this set-window-layer command, and might someone be 
able to tell me what it is?

Andrew Begel
MIT Media Lab
Epistemology and Learning