Flush mouseMove when initiating viewport dragging

We want to flush pending mouse moves before we initiate viewport
dragging.

Before this commit, there were scenarios where the _mouseButtonMask
would track a released button as being down.
This commit is contained in:
Adam Halim
2025-01-14 12:32:51 +01:00
parent d1548c12ec
commit 6383fa6384
2 changed files with 20 additions and 0 deletions

View File

@@ -1103,6 +1103,8 @@ export default class RFB extends EventTargetMixin {
this._viewportDragPos = {'x': pos.x, 'y': pos.y};
this._viewportHasMoved = false;
this._flushMouseMoveTimer(pos.x, pos.y);
// Skip sending mouse events, instead save the current
// mouse mask so we can send it later.
this._mouseButtonMask = bmask;