diff options
author | Jesus Fernandez <jesus.fernandez@qt.io> | 2018-09-14 13:50:42 +0200 |
---|---|---|
committer | Jesus Fernandez <Jesus.Fernandez@qt.io> | 2018-09-24 11:24:11 +0000 |
commit | 67aa03a4bc18a5de43148bc328229802fad8896b (patch) | |
tree | b100452c86c566db34359c6a08fb51e7f1fab452 /src | |
parent | da31eaa62c9f4bed76697ee54ad78ccc0d530493 (diff) |
Reload the browser when the socket disconnects
It tries to reload the browser to try to reconnect. If the remote
application closes, the browser will show the default disconnected page.
Doing this the user will know the session ended and it will free the
resources required to have a WebGL context alive in the browser.
[ChangeLog][QtWebGL][General] Reload the browser when the WebSocket
disconnects.
Change-Id: I724d74ef6e44ff6b89e557f77f65fa827198a47d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/webgl/webqt.jsx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/platforms/webgl/webqt.jsx b/src/plugins/platforms/webgl/webqt.jsx index 9feb0fe..a7de04d 100644 --- a/src/plugins/platforms/webgl/webqt.jsx +++ b/src/plugins/platforms/webgl/webqt.jsx @@ -1086,6 +1086,7 @@ window.onload = function () { }; socket.onclose = function (event) { console.log("Socket Closed (" + event.code + "): " + event.reason); + window.location.reload(); }; socket.onerror = function (error) { console.log("Socket error: " + error.toString()); |