to the thread list: the child thread would add itself to the
list which means there could be a time interval in the parent
where the child thread exists but isn't on the list. the
parent now does the adding and removing.
multiple times is *not* the same as calling XIfEvent() because the
former will re-encounter events that it didn't process previously.
to make things simple it now pulls events off the queue and saves
them if not processed for selection transfer and puts them back
afterwards.
when it wasn't necessary. (in particular, we were getting the
clipboard update time from the owner then emptying the clipboard,
so we didn't need to get the time. worse, most owners don't
support getting the time and we often timed out.)
also fixed a multithread bug using the X display. we were using
a CThread to send an event after a timeout while we were waiting
in XIfEvent(). this necessarily involved two threads calling
into Xlib at once, which is not allowed. now using polling to
do the timeout because Xlib doesn't have a function to get
events with a timeout.
motion events relative to the previous mouse position. for
example, if two mouse events arrive, the first at x+1,y and
the second at x+2,y, we used to compute deltas of 1,0 and 2,0
instead of 1,0 and 1,0. that's fixed. also worked around a
bug (probably) in windows that caused a motion event after a
SetCursorPos() to be lost or reported one pixel off from the
correct position. now using mouse_event() which doesn't
have that problem. also fixed calculation of normalized
coordinates for mouse_event() when there are multiple
displays.
also no longer warping mouse to 0,0 when setting server screen
info. that was causing the mouse to jump if the server screen
had itself as its left or top neighbor (directly or indirectly)
once a screen could be its own neighbor.
include a screen that was already connected under an alias
then that screen wouldn't be disconnected and removed from
the screen list until the screen voluntarily disconnected.
at that time removeConnection() would assert because the
screen name would not be found. now using the canonical
name in the protocol object as well as CServer. this
allows setConfig() to always detect removed screens and
disconnect them.