This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
Possible clipboard hang fix in the works
- From: Harold L Hunt II <huntharo at msu dot edu>
- To: cygx <cygwin-xfree at cygwin dot com>
- Date: Wed, 24 Mar 2004 01:02:28 -0500
- Subject: Possible clipboard hang fix in the works
- Reply-to: cygwin-xfree at cygwin dot com
I was just talking to 'jst' in irc.freenode.net about the periodic
hanging caused by the clipboard integration manager.
I took a peek at the source code again (it is tough to understand and
tough to not cause infinite loops, that's why I look at it about once
every 3 months) and realized that I left in something that never realy
intended to leave in: a blocking call that waits for an X application to
send clipboard data.
The part I am referring to is that we call XPeekIfEvent to wait for a
SelectionNotify event to be sent back to our clipboard manager. If an X
application is misbehaved or if something goes wrong, then that message
will never come. The problem with XPeekIfEvent is that it does not
allow for a timeout value to be specified, so it blocks forever if the
event never comes.
Upon a cursory inspection it should be almost trivial to replace the
call to XPeekIfEvent with a simple loop that does the same thing but has
a timeout value that prevents it from blocking indefinitely.
Course... that means we probably can't use select... so I'll have to
look at how XPeekIfEvent works and write something similar to it.
In any case, I might have a fix for this problem later this week or as
early as Wednesday.
Harold