Only the client that currently has buttons pressed should actually send
a release event as the client might not be currently in control of the
pointer state. This is most clearly seen in a client that hasn't event
authenticated properly yet.
Approximate this from the server by using the last known server cursor
position. It should hopefully not differ much from the last client
provided position.
Follow-up to
986280b382d57ef4f68d2d4afb13b26772e5acb0.
vlog.info("closing %s: %s", peerEndpoint.c_str(),
closeReason.c_str());
- // Release any mouse buttons
- server->pointerEvent(this, server->getCursorPos(), 0);
-
// Release any keys the client still had pressed
while (!pressedKeys.empty()) {
uint32_t keysym, keycode;
for (ci = clients.begin(); ci != clients.end(); ci++) {
if ((*ci)->getSock() == sock) {
// - Remove any references to it
- if (pointerClient == *ci)
+ if (pointerClient == *ci) {
+ // Release the mouse buttons the client have pressed
+ desktop->pointerEvent(cursorPos, 0);
pointerClient = nullptr;
+ }
if (clipboardClient == *ci)
handleClipboardAnnounce(*ci, false);
clipboardRequestors.remove(*ci);