diff --git a/guacamole/src/main/frontend/src/app/client/controllers/clientController.js b/guacamole/src/main/frontend/src/app/client/controllers/clientController.js index f76621bc7..4beecbacd 100644 --- a/guacamole/src/main/frontend/src/app/client/controllers/clientController.js +++ b/guacamole/src/main/frontend/src/app/client/controllers/clientController.js @@ -470,10 +470,6 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams var oldFocusedClient = $scope.focusedClient; $scope.focusedClient = newFocusedClient; - // Ignore if focus is not actually changing - if (oldFocusedClient === newFocusedClient) - return; - // Apply any parameter changes when focus is changing if (oldFocusedClient) $scope.applyParameterChanges(oldFocusedClient); diff --git a/guacamole/src/main/frontend/src/app/client/directives/guacTiledClients.js b/guacamole/src/main/frontend/src/app/client/directives/guacTiledClients.js index 99063769b..9b16217d6 100644 --- a/guacamole/src/main/frontend/src/app/client/directives/guacTiledClients.js +++ b/guacamole/src/main/frontend/src/app/client/directives/guacTiledClients.js @@ -74,7 +74,7 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient * The currently-focused client, or null if there are no focused * clients or if multiple clients are focused. */ - var getFocusedClient = function getFocusedClient() { + $scope.getFocusedClient = function getFocusedClient() { var managedClientGroup = $scope.clientGroup; if (managedClientGroup) { @@ -87,10 +87,9 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient }; - // Re-initialize the reference to the currently-focused client when a - // new client group is set - $scope.$watch('clientGroup', function clientGroupChanged() { - $scope.$emit('guacClientFocused', getFocusedClient()); + // Notify whenever identify of currently-focused client changes + $scope.$watch('getFocusedClient()', function focusedClientChanged(focusedClient) { + $scope.$emit('guacClientFocused', focusedClient); }); /** @@ -147,10 +146,6 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient } - // Update reference to single focused client after focus has - // changed - $scope.$emit('guacClientFocused', getFocusedClient()); - }; };