mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUACAMOLE-724: Ensure focus is not retained when transferring a client from an unattached group to an attached group.
This commit is contained in:
@@ -95,8 +95,20 @@ angular.module('client').factory('guacClientManager', ['$injector',
|
|||||||
|
|
||||||
// Remove client from all groups
|
// Remove client from all groups
|
||||||
managedClientGroups.forEach(group => {
|
managedClientGroups.forEach(group => {
|
||||||
_.remove(group.clients, client => (client.id === id));
|
var removed = _.remove(group.clients, client => (client.id === id));
|
||||||
ManagedClientGroup.recalculateTiles(group);
|
if (removed.length) {
|
||||||
|
|
||||||
|
// Reset focus state if client is being removed from a group
|
||||||
|
// that isn't currently attached (focus may otherwise be
|
||||||
|
// retained and result in a newly added connection unexpectedly
|
||||||
|
// sharing focus)
|
||||||
|
if (!group.attached)
|
||||||
|
removed.forEach(client => { client.clientProperties.focused = false; });
|
||||||
|
|
||||||
|
// Recalculate group grid if number of clients is changing
|
||||||
|
ManagedClientGroup.recalculateTiles(group);
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Remove any groups that are now empty
|
// Remove any groups that are now empty
|
||||||
|
Reference in New Issue
Block a user