mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 08:21:50 -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.$client.sendData('keyup', { key: this.keyMap(key) })
|
||||||
}
|
}
|
||||||
this.keyboard.listenTo(this._overlay)
|
this.keyboard.listenTo(this._overlay)
|
||||||
|
window.addEventListener('focus', this._onWindowFocus)
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
window.removeEventListener('focus', this._onWindowFocus)
|
||||||
this.observer.disconnect()
|
this.observer.disconnect()
|
||||||
this.$accessor.video.setPlayable(false)
|
this.$accessor.video.setPlayable(false)
|
||||||
/* Guacamole Keyboard does not provide destroy functions */
|
/* Guacamole Keyboard does not provide destroy functions */
|
||||||
@@ -845,6 +847,11 @@
|
|||||||
this.sendMousePos(e)
|
this.sendMousePos(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// stable reference for add/removeEventListener
|
||||||
|
private _onWindowFocus = () => {
|
||||||
|
if (this.hosting) this.syncClipboard()
|
||||||
|
}
|
||||||
|
|
||||||
onMouseEnter(e: MouseEvent) {
|
onMouseEnter(e: MouseEvent) {
|
||||||
if (this.hosting) {
|
if (this.hosting) {
|
||||||
this.$accessor.remote.syncKeyboardModifierState({
|
this.$accessor.remote.syncKeyboardModifierState({
|
||||||
|
|||||||
Reference in New Issue
Block a user