From 3bb1959a554ca7278fd622a23d69fd79c0978a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Fri, 31 Jul 2026 14:27:48 +0200 Subject: [PATCH] feat: sync clipboard on window focus. (#662) --- client/src/components/video.vue | 7 +++++++ 1 file changed, 7 insertions(+) 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({