mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUAC-605: Fix clipboard handling.
This commit is contained in:
@@ -86,8 +86,8 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams',
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Update the model when clipboard data received from client
|
// Update the model when clipboard data received from client
|
||||||
$scope.$on('guacClientClipboard', function clipboardDataReceived(clipboardData) {
|
$scope.$on('guacClientClipboard', function clientClipboardListener(event, client, mimetype, clipboardData) {
|
||||||
$scope.guacClipboard = clipboardData;
|
$scope.clipboardData = clipboardData;
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -135,12 +135,12 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams',
|
|||||||
$scope.$watch('menuShown', function setKeyboardEnabled(menuShown, menuShownPreviousState) {
|
$scope.$watch('menuShown', function setKeyboardEnabled(menuShown, menuShownPreviousState) {
|
||||||
|
|
||||||
// Send clipboard data if menu is hidden
|
// Send clipboard data if menu is hidden
|
||||||
if (!menuShown && menuShownPreviousState) {
|
if (!menuShown && menuShownPreviousState)
|
||||||
$scope.$broadcast('guacClipboard', $scope.clipboardData);
|
$scope.$broadcast('guacClipboard', 'text/plain', $scope.clipboardData);
|
||||||
}
|
|
||||||
|
|
||||||
// Disable client keyboard if the menu is shown
|
// Disable client keyboard if the menu is shown
|
||||||
$scope.clientProperties.keyboardEnabled = !menuShown;
|
$scope.clientProperties.keyboardEnabled = !menuShown;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) {
|
$scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) {
|
||||||
|
@@ -55,8 +55,6 @@ angular.module('client').directive('guacClient', [function guacClient() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.clipboard = "";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the local, hardware mouse cursor is in use.
|
* Whether the local, hardware mouse cursor is in use.
|
||||||
*
|
*
|
||||||
@@ -290,7 +288,7 @@ angular.module('client').directive('guacClient', [function guacClient() {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Update active client if clipboard changes
|
// Update active client if clipboard changes
|
||||||
$scope.$watch('clipboard', function clipboardChange(data) {
|
$scope.$on('guacClipboard', function onClipboard(event, mimetype, data) {
|
||||||
if (client)
|
if (client)
|
||||||
client.setClipboard(data);
|
client.setClipboard(data);
|
||||||
});
|
});
|
||||||
|
@@ -67,11 +67,6 @@ angular.module('client').factory('guacClientFactory', ['$rootScope',
|
|||||||
// Connected
|
// Connected
|
||||||
case 3:
|
case 3:
|
||||||
$scope.$emit('guacClientStateChange', guacClient, "connected");
|
$scope.$emit('guacClientStateChange', guacClient, "connected");
|
||||||
|
|
||||||
// Update server clipboard with current data
|
|
||||||
if ($scope.clipboard)
|
|
||||||
guacClient.setClipboard($scope.clipboard);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Disconnecting / disconnected are handled by tunnel instead
|
// Disconnecting / disconnected are handled by tunnel instead
|
||||||
@@ -131,7 +126,7 @@ angular.module('client').factory('guacClientFactory', ['$rootScope',
|
|||||||
|
|
||||||
// Emit event when done
|
// Emit event when done
|
||||||
reader.onend = function clipboard_text_end() {
|
reader.onend = function clipboard_text_end() {
|
||||||
$scope.$emit('guacClientClipboard', guacClient, data);
|
$scope.$emit('guacClientClipboard', guacClient, mimetype, data);
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user