diff --git a/app/ui.js b/app/ui.js index ae5cc946..3d5bb0f0 100644 --- a/app/ui.js +++ b/app/ui.js @@ -459,6 +459,8 @@ const UI = { .addEventListener('change', UI.clipboardSend); document.getElementById("noVNC_clipboard_clear_button") .addEventListener('click', UI.clipboardClear); + + window.addEventListener("focus", UI.copyFromLocalClipboard); }, // Add a call to save settings when the element changes, @@ -1947,8 +1949,6 @@ const UI = { keepVirtualKeyboard(event) { const input = document.getElementById('noVNC_keyboardinput'); - UI.copyFromLocalClipboard(); - // Only prevent focus change if the virtual keyboard is active if (document.activeElement != input) { return; diff --git a/core/rfb.js b/core/rfb.js index 2850d972..a42e724a 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -764,6 +764,7 @@ export default class RFB extends EventTargetMixin { } let h = hashUInt8Array(data); + // avoid resending the same data if larger than 64k if (h === this._clipHash) { Log.Debug('No clipboard changes'); return; @@ -802,6 +803,7 @@ export default class RFB extends EventTargetMixin { if (!h) { h = hashUInt8Array(data); + // avoid resending the same data if larger than 64k if (h === this._clipHash) { Log.Debug('No clipboard changes'); return;