diff --git a/client/src/components/video.vue b/client/src/components/video.vue index 051493e1..687eab3e 100644 --- a/client/src/components/video.vue +++ b/client/src/components/video.vue @@ -532,9 +532,11 @@ this.$client.sendData('keyup', { key: this.keyMap(key) }) } this.keyboard.listenTo(this._overlay) + window.addEventListener('focus', this._onWindowFocus) } beforeDestroy() { + window.removeEventListener('focus', this._onWindowFocus) this.observer.disconnect() this.$accessor.video.setPlayable(false) /* Guacamole Keyboard does not provide destroy functions */ @@ -845,6 +847,11 @@ this.sendMousePos(e) } + // stable reference for add/removeEventListener + private _onWindowFocus = () => { + if (this.hosting) this.syncClipboard() + } + onMouseEnter(e: MouseEvent) { if (this.hosting) { this.$accessor.remote.syncKeyboardModifierState({