[Openmcl-devel] Some progress on the cursor-blink bug

Ron Garret ron at awun.net
Sun Jan 27 01:17:13 PST 2008


I decided to try to beat on the cursor blink bug (http://trac.clozure.com/openmcl/ticket/64 
) a little tonight and I think I've made some progress.  As far as I  
can tell, two drawInsertionPointInRect:color:turnedOn: method is being  
called from two different locations within OS X.  My guess is that one  
of these is the keystroke event handler and the other is the scheduled  
task that causes the cursor to blink.

When drawInsertionPointInRect:color:turnedOn: is called from the  
scheduled cursor-blink task everything happens as it should.

When the method is called from the key event handler two odd things  
happen.  The first is that the flag argument, which should be T (to  
indicate that the cursor should be drawn and the matching close-paren  
should not be) is NIL.

Despite the fact that FLAG is NIL, the cursor does in fact get drawn  
(by OS X, not the drawInsertionPointInRect:color:turnedOn: method as  
far as I can tell).

The second odd thing is this:

The way the matching-paren-blink logic works, the matching paren is  
unconditionally erased, then conditionally redrawn if FLAG is NIL.   
That the matching paren is not erased is the expected result of FLAG  
being NIL and not T as it should be.  However, it turns out that the  
matching paren is never even being erased despite the fact that  
drawInsertionPointInRect:color:turnedOn: is in fact being called.  The  
easiest way to see this is to replace

(#/set blink-color)

with

(#/set (#/grayColor ns:ns-color))

Now whenever the matching paren is erased it will be written over in  
gray.  Type a few open a close parens and it will be immediately  
apparent that the gray box is not being drawn when  
drawInsertionPointInRect:color:turnedOn: is called from the key event  
handler.  (I have verified that the method is in fact being called,  
and that the code to erase the paren is being reached.)

The only theory I can come up with to explain this is that the  
graphics focus is not properly set, but it would seem to me that if  
that were the case then other things would be going wrong, and they  
aren't.

I have now reached the current limits of my expertise (and wakefulness).

rg

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20080127/a8524331/attachment.htm>


More information about the Openmcl-devel mailing list