Fixed clipboard (partially) for guacamole

This commit is contained in:
Adolfo Gómez García 2020-08-20 14:45:21 +02:00
parent 5c5ddd147c
commit 5e4114c719
2 changed files with 12 additions and 2 deletions

View File

@ -88,7 +88,7 @@
<dependency>
<groupId>org.apache.guacamole</groupId>
<artifactId>guacamole-common-js</artifactId>
<version>1.1.0</version>
<version>1.2.0</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>

View File

@ -1067,7 +1067,17 @@ GuacUI.Client.setClipboard = function(data) {
if (data !== GuacUI.Client.remote_clipboard && GuacUI.Client.attachedClient) {
GuacUI.Client.remote_clipboard = data;
GuacUI.Client.attachedClient.setClipboard(data);
//GuacUI.Client.attachedClient.setClipboard(data);
// Old setClipboard funtion
var stream = GuacUI.Client.attachedClient.createClipboardStream('text/plain')
var writer = new Guacamole.StringWriter(stream);
// Send text chunks
for (var i=0; i<data.length; i += 4096)
writer.sendText(data.substring(i, i+4096));
// Close stream
writer.sendEnd();
}
};