mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +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 | ||||
|     $scope.$on('guacClientClipboard', function clipboardDataReceived(clipboardData) { | ||||
|        $scope.guacClipboard = clipboardData;  | ||||
|     $scope.$on('guacClientClipboard', function clientClipboardListener(event, client, mimetype, clipboardData) { | ||||
|        $scope.clipboardData = clipboardData;  | ||||
|     }); | ||||
|              | ||||
|     /* | ||||
| @@ -135,12 +135,12 @@ angular.module('home').controller('clientController', ['$scope', '$routeParams', | ||||
|     $scope.$watch('menuShown', function setKeyboardEnabled(menuShown, menuShownPreviousState) { | ||||
|          | ||||
|         // Send clipboard data if menu is hidden | ||||
|         if (!menuShown && menuShownPreviousState) { | ||||
|             $scope.$broadcast('guacClipboard', $scope.clipboardData);  | ||||
|         } | ||||
|         if (!menuShown && menuShownPreviousState) | ||||
|             $scope.$broadcast('guacClipboard', 'text/plain', $scope.clipboardData);  | ||||
|          | ||||
|         // Disable client keyboard if the menu is shown | ||||
|         $scope.clientProperties.keyboardEnabled = !menuShown; | ||||
|  | ||||
|     }); | ||||
|      | ||||
|     $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. | ||||
|              *  | ||||
| @@ -290,7 +288,7 @@ angular.module('client').directive('guacClient', [function guacClient() { | ||||
|              */ | ||||
|  | ||||
|             // Update active client if clipboard changes | ||||
|             $scope.$watch('clipboard', function clipboardChange(data) { | ||||
|             $scope.$on('guacClipboard', function onClipboard(event, mimetype, data) { | ||||
|                 if (client) | ||||
|                     client.setClipboard(data); | ||||
|             }); | ||||
|   | ||||
| @@ -67,11 +67,6 @@ angular.module('client').factory('guacClientFactory', ['$rootScope', | ||||
|                     // Connected | ||||
|                     case 3: | ||||
|                         $scope.$emit('guacClientStateChange', guacClient, "connected"); | ||||
|  | ||||
|                         // Update server clipboard with current data | ||||
|                         if ($scope.clipboard) | ||||
|                             guacClient.setClipboard($scope.clipboard); | ||||
|  | ||||
|                         break; | ||||
|  | ||||
|                     // Disconnecting / disconnected are handled by tunnel instead | ||||
| @@ -131,7 +126,7 @@ angular.module('client').factory('guacClientFactory', ['$rootScope', | ||||
|  | ||||
|                 // Emit event when done | ||||
|                 reader.onend = function clipboard_text_end() { | ||||
|                     $scope.$emit('guacClientClipboard', guacClient, data); | ||||
|                     $scope.$emit('guacClientClipboard', guacClient, mimetype, data); | ||||
|                 }; | ||||
|  | ||||
|             }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user