GUAC-1480: Consume 'guacClipboard' events ONLY in guacClient directive. Use 
'guacClipboard' events as the sole source of clipboard data - do not scope 
watch.

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/443e93a3
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/443e93a3
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/443e93a3

Branch: refs/heads/master
Commit: 443e93a3c26a565da0774d2d2e9bd4727ead1332
Parents: 948ccff
Author: Michael Jumper <[email protected]>
Authored: Tue Feb 9 14:05:48 2016 -0800
Committer: Michael Jumper <[email protected]>
Committed: Tue Feb 9 14:05:48 2016 -0800

----------------------------------------------------------------------
 .../src/main/webapp/app/client/controllers/clientController.js | 5 -----
 guacamole/src/main/webapp/app/client/directives/guacClient.js  | 6 ++++--
 2 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/443e93a3/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 e1b5c99..2e7fe0d 100644
--- a/guacamole/src/main/webapp/app/client/controllers/clientController.js
+++ b/guacamole/src/main/webapp/app/client/controllers/clientController.js
@@ -379,11 +379,6 @@ angular.module('client').controller('clientController', 
['$scope', '$routeParams
 
     });
 
-    // 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/443e93a3/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 31f17fd..e23eb79 100644
--- a/guacamole/src/main/webapp/app/client/directives/guacClient.js
+++ b/guacamole/src/main/webapp/app/client/directives/guacClient.js
@@ -413,9 +413,11 @@ angular.module('client').directive('guacClient', [function 
guacClient() {
             };
 
             // Update remote clipboard if local clipboard changes
-            $scope.$watch('client.clipboardData', function 
clipboardChanged(data) {
-                if (client)
+            $scope.$on('guacClipboard', function onClipboard(event, mimetype, 
data) {
+                if (client) {
                     client.setClipboard(data);
+                    $scope.client.clipboardData = data;
+                }
             });
 
             // Translate local keydown events to remote keydown events if 
keyboard is enabled

Reply via email to