|
|
|
|
|
|
|
|
: blHosts(&blacklist), desktop(desktop_), desktopStarted(false), |
|
|
: blHosts(&blacklist), desktop(desktop_), desktopStarted(false), |
|
|
blockCounter(0), pb(0), ledState(ledUnknown), |
|
|
blockCounter(0), pb(0), ledState(ledUnknown), |
|
|
name(name_), pointerClient(0), clipboardClient(0), |
|
|
name(name_), pointerClient(0), clipboardClient(0), |
|
|
|
|
|
pointerClientTime(0), |
|
|
comparer(0), cursor(new Cursor(0, 0, Point(), NULL)), |
|
|
comparer(0), cursor(new Cursor(0, 0, Point(), NULL)), |
|
|
renderedCursorInvalid(false), |
|
|
renderedCursorInvalid(false), |
|
|
keyRemapper(&KeyRemapper::defInstance), |
|
|
keyRemapper(&KeyRemapper::defInstance), |
|
|
|
|
|
|
|
|
void VNCServerST::pointerEvent(VNCSConnectionST* client, |
|
|
void VNCServerST::pointerEvent(VNCSConnectionST* client, |
|
|
const Point& pos, int buttonMask) |
|
|
const Point& pos, int buttonMask) |
|
|
{ |
|
|
{ |
|
|
|
|
|
time_t now = time(0); |
|
|
if (rfb::Server::maxIdleTime) |
|
|
if (rfb::Server::maxIdleTime) |
|
|
idleTimer.start(secsToMillis(rfb::Server::maxIdleTime)); |
|
|
idleTimer.start(secsToMillis(rfb::Server::maxIdleTime)); |
|
|
|
|
|
|
|
|
// Let one client own the cursor whilst buttons are pressed in order |
|
|
// Let one client own the cursor whilst buttons are pressed in order |
|
|
// to provide a bit more sane user experience |
|
|
|
|
|
if ((pointerClient != NULL) && (pointerClient != client)) |
|
|
|
|
|
|
|
|
// to provide a bit more sane user experience. But limit the time to prevent |
|
|
|
|
|
// locking out all others when e.g. the network is down. |
|
|
|
|
|
if ((pointerClient != NULL) && (pointerClient != client) && ((now - pointerClientTime) < 3)) |
|
|
return; |
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
pointerClientTime = now; |
|
|
if (buttonMask) |
|
|
if (buttonMask) |
|
|
pointerClient = client; |
|
|
pointerClient = client; |
|
|
else |
|
|
else |