[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[NSCursor +setHiddenUntilMouseMoves:]
From: |
Adrian Robert |
Subject: |
[NSCursor +setHiddenUntilMouseMoves:] |
Date: |
Wed, 12 Jan 2005 12:23:57 -0500 |
Hi,
While working on Emacs I found that [NSCursor
+setHiddenUntilMouseMoves:] wasn't working for me: whenever a key was
typed, the mouse reappeared as if the mouse had moved. I traced this
to the following: when Emacs receives a key event, it halts GNUstep's
event loop to allow Emacs's own event loop to continue and process it.
In NSApplication, this causes, at line 1497 in -stop:, a 'null_event'
to be posted to the DPSServer, supposedly to "allow one more pass
through the loop". The problem is, later on during this one more pass,
line 1664 misinterprets this as a valid event of type NSLeftMouseDown
(which happens to be zero in the NSEventType enumeration), and calls
[NSCursor -setHiddenUntilMouseMoves: NO].
Two possible fixes:
1) Do not post null_event on -stop:. I commented this line out with
no
ill effects, though obviously more testing is needed than that.
2) Delay the updating of [NSCursor setHiddenUntilMouseMoves:] until
somewhere around line 1179, i.e., AFTER the initial masked event
retrieval from the DPSServer where was posted. Here, the
'null_event'
is already filtered out by an 'if'.
#2 is the least invasive change, however it would be nice to know the
reasons for posting 'null_event' on -stop: and whether it is still
needed. Also, if delaying showing the mouse this long is undesirable,
detection for 'null_event' could be inserted into the method at line
1664.
Any thoughts?
- [NSCursor +setHiddenUntilMouseMoves:],
Adrian Robert <=