mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 00:11:48 -06:00
feat: sync clipboard on window focus. (#662)
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user