From fa07c4532cf29735ba7904570e9ba8539fc5cd91 Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Thu, 15 Oct 2020 17:54:28 +0200 Subject: [PATCH] Fix player process not exiting after window close --- clapper_src/app.js | 3 --- clapper_src/interface.js | 7 +++++++ clapper_src/player.js | 3 --- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/clapper_src/app.js b/clapper_src/app.js index e429e57c..a3649c88 100644 --- a/clapper_src/app.js +++ b/clapper_src/app.js @@ -390,10 +390,7 @@ var App = GObject.registerClass({ _onWindowCloseRequest() { - this.window.destroy(); - this.player.widget.emit('destroy'); this.interface.emit('destroy'); - this.quit(); } }); diff --git a/clapper_src/interface.js b/clapper_src/interface.js index 602fbf8f..cb2b4b50 100644 --- a/clapper_src/interface.js +++ b/clapper_src/interface.js @@ -468,6 +468,13 @@ class ClapperInterface extends Gtk.Grid _onDestroy() { this.disconnect(this.destroySignal); + + if( + this._player + && this._player.state !== GstPlayer.PlayerState.STOPPED + ) + this._player.stop(); + this.controls.emit('destroy'); } }); diff --git a/clapper_src/player.js b/clapper_src/player.js index fc59430d..0db1e644 100644 --- a/clapper_src/player.js +++ b/clapper_src/player.js @@ -287,9 +287,6 @@ class ClapperPlayer extends GstPlayer.Player while(this._playerSignals.length) this.disconnect(this._playerSignals.pop()); - if(this.state !== GstPlayer.PlayerState.STOPPED) - this.stop(); - if(this.run_loop && this.loop.is_running()) this.loop.quit(); }