diff --git a/guacamole/src/main/webapp/client.xhtml b/guacamole/src/main/webapp/client.xhtml index 417712d3b..d4bf76ead 100644 --- a/guacamole/src/main/webapp/client.xhtml +++ b/guacamole/src/main/webapp/client.xhtml @@ -141,6 +141,12 @@ GuacUI.Client.showError("Connection Error", message); }; + // Notify of disconnections (if not already notified of something else) + tunnel.onstatechange = function(state) { + if (state === Guacamole.Tunnel.State.CLOSED && !GuacUI.Client.visibleStatus) + GuacUI.Client.showStatus("Disconnected", "You have been disconnected. Reload the page to reconnect."); + }; + // Connect guac.connect(connect_string); diff --git a/guacamole/src/main/webapp/scripts/client-ui.js b/guacamole/src/main/webapp/scripts/client-ui.js index bd4f79153..21568a911 100644 --- a/guacamole/src/main/webapp/scripts/client-ui.js +++ b/guacamole/src/main/webapp/scripts/client-ui.js @@ -890,16 +890,9 @@ GuacUI.Client.attach = function(guac) { break; - // Disconnecting + // Disconnecting / disconnected are handled by tunnel instead case 4: - GuacUI.Client.showStatus(null, "Disconnecting..."); - GuacUI.Client.titlePrefix = "[Disconnecting...]"; - break; - - // Disconnected case 5: - GuacUI.Client.showStatus("Disconnected", "Guacamole has been manually disconnected. Reload the page to reconnect."); - GuacUI.Client.titlePrefix = "[Disconnected]"; break; // Unknown status code