fix clipboard write to client from secondary screen
This commit is contained in:
parent
d51c5e37b7
commit
82e0100a97
21
core/rfb.js
21
core/rfb.js
|
@ -1738,6 +1738,11 @@ export default class RFB extends EventTargetMixin {
|
|||
this._mouseLastScreenIndex = event.data.mouseLastScreenIndex;
|
||||
}
|
||||
break;
|
||||
case 'receivedClipboard':
|
||||
if (event.data.mouseLastScreenIndex === this._display.screenIndex) {
|
||||
this._write_binary_clipboard(...event.data.args);
|
||||
}
|
||||
break;
|
||||
case 'disconnect':
|
||||
this.disconnect();
|
||||
break;
|
||||
|
@ -3216,6 +3221,18 @@ export default class RFB extends EventTargetMixin {
|
|||
if (this.clipboardBinary) {
|
||||
this._clipHash = 0;
|
||||
|
||||
if (this._mouseLastScreenIndex === 0) {
|
||||
this._write_binary_clipboard(clipItemData, textdata)
|
||||
} else {
|
||||
this._proxyRFBMessage('receivedClipboard', [ clipItemData, textdata ]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
_write_binary_clipboard(clipItemData, textdata) {
|
||||
navigator.clipboard.write([new ClipboardItem(clipItemData)]).then(
|
||||
() => {
|
||||
if (textdata) {
|
||||
|
@ -3238,10 +3255,6 @@ export default class RFB extends EventTargetMixin {
|
|||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
_handle_server_stats_msg() {
|
||||
this._sock.rQskipBytes(3); // Padding
|
||||
|
|
Loading…
Reference in New Issue