all use format() the same way. also changed format() to actually
do formatting. however, it doesn't try looking up formatting
strings by id, it just uses the fallback format string.
that uses poll() to process events more efficiently. it won't
wake up nor sleep any more than necessary, unlike the platform
independent implementation that polls and sleeps.
the main change is that WM_QUIT now causes the thread to be
cancelled instead of mainLoop() just returning. this also
requires runDaemon() to call the run function in a new thread
each time it calls it because it could can cancelled.
restart if the X server connection was lost; since synergy
is likely to be started by xdm or the user's xsession, it's
better for synergy to simply terminate when the connection
is lost. synergy will still restart due to other errors.
also fixed numerous other minor bugs and cleaned some stuff
up (like app error codes are now consistent and enumerated
in Version.h, for lack of a better place). and boosted
version and protocol numbers.
known to the caller. if the client supports more formats than
the server then the server could get a clipboard format greater
than kNumFormats. with this change the server discards the
extra formats instead of crashing.
if they cannot be used on an X server using authentication
because the daemons they start are not authorized to connect to
the X server. X users should modify Xsetup or Xsession.
call cleanup(). if that process still appears to exist then the
init() fails. otherwise some cleanup is performed and the init()
proceeds. a synergy server started while another is running will
now exit immediately without interfering the original server.
cancelling any other threads. this prevents a race condition
where we disconnect a client but it reconnects before we
manage to shutdown. that might leave a thread running and
the connection won't be closed down properly.
MsgWaitForMultipleObjects(): it will not return immediately
if an event already in the queue when it's called was already
in the queue during the last call to GetMessage()/PeekMessage().
also now discarding screen saver events if there are any other
screen saver events in the queue already. this prevents these
events from piling up in the queue, which they'd do because we
sleep for 250ms when handling each one.