Bugfix/kasm 2242 clipboard sync (#26)

* KASM-2242 clipboard behavior correction

* remove clipboard length check

Co-authored-by: matt <matt@kasmweb.com>
This commit is contained in:
Matt McClaskey 2022-01-31 09:39:19 -05:00 committed by GitHub
parent ad1fc1f06d
commit df9c9d0d96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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;