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.
work but will let testers make the final call. also fixed
desktop synchronization by setting a variable that was
mistakenly left unset. and tried to work around an apparent
bug in MsgWaitForMultipleObjects() that prevented the service
from closing down properly. start/pause/continue/stop
sequence still doesn't shut down correctly. start/pause/stop
and start/stop work fine.
screens into CPrimaryScreen and merged common code from secondary
screens into CSecondaryScreen. changed is-a relationship to a
has-a between the primary and secondary screen classes and the
generic platform dependent screen class to avoid multiple
inheritance of implementation. also standardized the interface
for those generic screen classes. adding a platform now involves
implementing simpler interfaces: IScreen for the generic screen,
IScreenEventHandler and some methods of CPrimaryScreen for the
primary screen, and IScreenEventHandler and some methods of
CSecondaryScreen for the secondary screen. did X11 platform
but not win32 platform.
minor changes to support IPrimaryReciever's functionality. this
does mean that the IPrimaryScreen class will be calling some
methods with dummy arguments. those are documented in
CPrimaryClient.
now speaks to the primary screen and secondary screens almost
everywhere the same way through an IClient interface; only
special primary screen calls are accessed through a different
interface, the CPrimaryClient interface. this simplifies the
server since it no longer needs to test whether the active screen
is the primary or a secondary in most cases.
the server no longer speaks directly to the primary screen; all
that goes through the CPrimaryClient, which often just forwards
the call. the primary screen no longer speaks directly to the
server either, again going through the CPrimaryClient via a
IPrimaryReceiver interface.
CServerProtocol classes have been replaced by CClientProxy
classes which are very similar. the name makes more sense
though.
the client screen is closed. this fixes the bug where the
client's keyboard was left with some keys logically pressed
when the client died (e.g. using ctrl+c on the client program
from the server's keyboard would leave the ctrl key logically
pressed).
init() it while it's already running. fixed an uninitialized
pointer bug in CServer and some cleanup-on-error code in
CMSWindowsPrimaryScreen. also added timeout to read() on
IInputStream and a heartbeat sent by clients so the server
can disconnect clients that are dead but never reset the TCP
connection. previously the server would keep these dead
clients around forever and if the user was locked on the
client screen for some reason then the server would have to
be rebooted (or the server would have to be killed via a
remote login).
and back to secondary when it stops. also now redirecting
keyboard input to root window when screen saver starts; this
allows the user to type in the lock dialog and also effectively
discards any input used to deactivate the screen saver.
activation. previously the timer would deactivate the screen
saver shortly after activation. job timer is restored when
the screen saver is deactivated.
installing and uninstalling the new error handler, causing
errors before the lock to be caught and errors during the lock
to not be caught. had to add Display* as argument to c'tor.
and untested. also some known problems: not detecting an
xscreensaver started after us and not detecting built-in
screen saver activation (not sure if we can without using
ugly extensions).
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.