GUACAMOLE-724: Always emit focus events when focused client changes, even if the change occurs only due to replacing a disconnected client with a connected one.

This commit is contained in:
Michael Jumper
2021-07-04 20:05:36 -07:00
parent 902a111a57
commit 69ea8488f3
2 changed files with 4 additions and 13 deletions

View File

@@ -470,10 +470,6 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
var oldFocusedClient = $scope.focusedClient; var oldFocusedClient = $scope.focusedClient;
$scope.focusedClient = newFocusedClient; $scope.focusedClient = newFocusedClient;
// Ignore if focus is not actually changing
if (oldFocusedClient === newFocusedClient)
return;
// Apply any parameter changes when focus is changing // Apply any parameter changes when focus is changing
if (oldFocusedClient) if (oldFocusedClient)
$scope.applyParameterChanges(oldFocusedClient); $scope.applyParameterChanges(oldFocusedClient);

View File

@@ -74,7 +74,7 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient
* The currently-focused client, or null if there are no focused * The currently-focused client, or null if there are no focused
* clients or if multiple clients are focused. * clients or if multiple clients are focused.
*/ */
var getFocusedClient = function getFocusedClient() { $scope.getFocusedClient = function getFocusedClient() {
var managedClientGroup = $scope.clientGroup; var managedClientGroup = $scope.clientGroup;
if (managedClientGroup) { if (managedClientGroup) {
@@ -87,10 +87,9 @@ angular.module('client').directive('guacTiledClients', [function guacTiledClient
}; };
// Re-initialize the reference to the currently-focused client when a // Notify whenever identify of currently-focused client changes
// new client group is set $scope.$watch('getFocusedClient()', function focusedClientChanged(focusedClient) {
$scope.$watch('clientGroup', function clientGroupChanged() { $scope.$emit('guacClientFocused', focusedClient);
$scope.$emit('guacClientFocused', getFocusedClient());
}); });
/** /**
@@ -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());
}; };
}; };