diff --git a/clapper_src/webClient.js b/clapper_src/webClient.js index a1397f45..938586dc 100644 --- a/clapper_src/webClient.js +++ b/clapper_src/webClient.js @@ -57,7 +57,7 @@ class ClapperWebClient extends Soup.Session } if(!connection) - return; + return this.passMsgData('close'); connection.connect('message', this._onWsMessage.bind(this)); connection.connect('closed', this._onWsClosed.bind(this)); @@ -78,5 +78,7 @@ class ClapperWebClient extends Soup.Session _onWsClosed(connection) { debug('closed WebSocket connection'); + + this.passMsgData('close'); } }); diff --git a/clapper_src/widgetRemote.js b/clapper_src/widgetRemote.js index 79a95961..ba0cddfe 100644 --- a/clapper_src/widgetRemote.js +++ b/clapper_src/widgetRemote.js @@ -9,5 +9,18 @@ class ClapperWidgetRemote extends Gtk.Grid super._init(); this.player = new PlayerRemote(); + this.player.webclient.passMsgData = this.receiveWs.bind(this); + } + + receiveWs(action, value) + { + switch(action) { + case 'close': + let root = this.get_root(); + root.run_dispose(); + break; + default: + break; + } } });