GUAC-1480: Fix broken menu clipboard regression.
Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/a492e2a8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/a492e2a8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/a492e2a8 Branch: refs/heads/master Commit: a492e2a8f32cbd34b598b6886e330847a1ac0bda Parents: 1564aee Author: James Muehlner <[email protected]> Authored: Mon Feb 8 21:39:58 2016 -0800 Committer: James Muehlner <[email protected]> Committed: Mon Feb 8 21:39:58 2016 -0800 ---------------------------------------------------------------------- .../main/webapp/app/client/controllers/clientController.js | 9 +++++++-- .../src/main/webapp/app/client/directives/guacClient.js | 6 ++---- 2 files changed, 9 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/a492e2a8/guacamole/src/main/webapp/app/client/controllers/clientController.js ---------------------------------------------------------------------- diff --git a/guacamole/src/main/webapp/app/client/controllers/clientController.js b/guacamole/src/main/webapp/app/client/controllers/clientController.js index 99bf723..e1b5c99 100644 --- a/guacamole/src/main/webapp/app/client/controllers/clientController.js +++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js @@ -372,13 +372,18 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams // Send clipboard data if menu is hidden if (!menuShown && menuShownPreviousState) - $scope.$broadcast('guacClipboard', 'text/plain', $scope.client.clipboardData); + $scope.$broadcast('guacClipboard', 'text/plain', $scope.client.clipboardData); // Disable client keyboard if the menu is shown $scope.client.clientProperties.keyboardEnabled = !menuShown; }); - + + // Update remote clipboard if local clipboard changes + $scope.$on('guacClipboard', function onClipboard(event, mimetype, data) { + $scope.client.clipboardData = data; + }); + $scope.$on('guacKeydown', function keydownListener(event, keysym, keyboard) { keysCurrentlyPressed[keysym] = true; http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/a492e2a8/guacamole/src/main/webapp/app/client/directives/guacClient.js ---------------------------------------------------------------------- diff --git a/guacamole/src/main/webapp/app/client/directives/guacClient.js b/guacamole/src/main/webapp/app/client/directives/guacClient.js index f12cc79..31f17fd 100644 --- a/guacamole/src/main/webapp/app/client/directives/guacClient.js +++ b/guacamole/src/main/webapp/app/client/directives/guacClient.js @@ -413,11 +413,9 @@ angular.module('client').directive('guacClient', [function guacClient() { }; // Update remote clipboard if local clipboard changes - $scope.$on('guacClipboard', function onClipboard(event, mimetype, data) { - if (client && data !== $scope.client.clipboardData) { + $scope.$watch('client.clipboardData', function clipboardChanged(data) { + if (client) client.setClipboard(data); - $scope.client.clipboardData = data; - } }); // Translate local keydown events to remote keydown events if keyboard is enabled
