-
Notifications
You must be signed in to change notification settings - Fork 71
fix(chromium-headful): sync clipboard to viewers under implicit hosting #311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -280,6 +280,10 @@ | |
| return this.$accessor.connecting | ||
| } | ||
|
|
||
| get controlling() { | ||
| return this.$accessor.remote.controlling | ||
| } | ||
|
|
||
| get hosting() { | ||
| return this.$accessor.remote.hosting | ||
| } | ||
|
|
@@ -804,14 +808,18 @@ | |
| first.target.dispatchEvent(simulatedEvent) | ||
| } | ||
|
|
||
| isMouseDown = false | ||
|
|
||
| onMouseDown(e: MouseEvent) { | ||
| this.unmuteOnInteraction() | ||
| this.isMouseDown = true | ||
|
|
||
| if (!this.hosting) { | ||
| this.$emit('control-attempt', e) | ||
| if (this.locked) { | ||
| return | ||
| } | ||
|
|
||
| if (!this.hosting || this.locked) { | ||
| if (!this.controlling) { | ||
| this.implicitHostingRequest(e) | ||
| return | ||
| } | ||
|
|
||
|
|
@@ -820,14 +828,57 @@ | |
| } | ||
|
|
||
| onMouseUp(e: MouseEvent) { | ||
| if (!this.hosting || this.locked) { | ||
| // only if we are the one who started the mouse down | ||
| if (!this.isMouseDown) return | ||
| this.isMouseDown = false | ||
|
|
||
| if (this.locked) { | ||
| return | ||
| } | ||
|
|
||
| if (!this.controlling) { | ||
| this.implicitHostingRequest(e) | ||
| return | ||
| } | ||
|
|
||
| this.sendMousePos(e) | ||
| this.$client.sendData('mouseup', { key: e.button + 1 }) | ||
| } | ||
|
|
||
| private reqMouseDown: MouseEvent | null = null | ||
| private reqMouseUp: MouseEvent | null = null | ||
|
|
||
| @Watch('controlling') | ||
| onControlChange(controlling: boolean) { | ||
| if (controlling && this.reqMouseDown) { | ||
| this.onMouseDown(this.reqMouseDown) | ||
| } | ||
|
|
||
| if (controlling && this.reqMouseUp) { | ||
| this.onMouseUp(this.reqMouseUp) | ||
| } | ||
|
|
||
| this.reqMouseDown = null | ||
| this.reqMouseUp = null | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incomplete click replay stuck buttonMedium Severity Under implicit hosting, a Additional Locations (1)Reviewed by Cursor Bugbot for commit 0388493. Configure here. |
||
|
|
||
| implicitHostingRequest(e: MouseEvent) { | ||
| if (this.implicitHosting) { | ||
| if (e.type === 'mousedown') { | ||
| this.reqMouseDown = e | ||
| this.reqMouseUp = null | ||
| this.$accessor.remote.request() | ||
| } else if (e.type === 'mouseup') { | ||
| this.reqMouseUp = e | ||
| } | ||
| return | ||
| } | ||
|
|
||
| if (e.type === 'mousedown') { | ||
| this.$emit('control-attempt', e) | ||
| } | ||
| } | ||
|
|
||
| onMouseMove(e: MouseEvent) { | ||
| if (!this.hosting || this.locked) { | ||
| return | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Buffered mouseup replay skipped
Medium Severity
If control is lost after a forwarded
mousedownbut beforemouseup, the physicalmouseupclearsisMouseDownand only storesreqMouseUpbecausecontrollingis false. Whencontrollingbecomes true again,@Watch('controlling')replays viaonMouseUp, which returns immediately whenisMouseDownis false, so the remote never getsmouseup. A later implicitmousedownclearsreqMouseUpwithout flushing that state, leaving a stuck pressed button on the remote.Additional Locations (1)
images/chromium-headful/client/src/components/video.vue#L864-L870Reviewed by Cursor Bugbot for commit 0388493. Configure here.