diff --git a/clapper_src/buttons.js b/clapper_src/buttons.js index e6e8ed3f..5e66811f 100644 --- a/clapper_src/buttons.js +++ b/clapper_src/buttons.js @@ -157,6 +157,7 @@ class ClapperPopoverButton extends IconButton this.popover.add_css_class('osd'); this.popover.connect('closed', this._onClosed.bind(this)); + this.popover.set_parent(this); } setFullscreenMode(isFullscreen) @@ -181,7 +182,6 @@ class ClapperPopoverButton extends IconButton super.vfunc_clicked(); this.set_state_flags(Gtk.StateFlags.CHECKED, false); - this.popover.set_parent(this); this.popover.popup(); } @@ -190,7 +190,11 @@ class ClapperPopoverButton extends IconButton let { player } = this.get_ancestor(Gtk.Grid); player.widget.grab_focus(); - this.popover.unparent(); this.unset_state_flags(Gtk.StateFlags.CHECKED); } + + _onCloseRequest() + { + this.popover.unparent(); + } }); diff --git a/clapper_src/controls.js b/clapper_src/controls.js index 6dd891ea..ba162291 100644 --- a/clapper_src/controls.js +++ b/clapper_src/controls.js @@ -467,4 +467,14 @@ class ClapperControls extends Gtk.Box break; } } + + _onCloseRequest() + { + for(let button of this.buttonsArr) { + if(!button._onCloseRequest) + continue; + + button._onCloseRequest(); + } + } }); diff --git a/clapper_src/player.js b/clapper_src/player.js index ef3896b0..1d41d7e2 100644 --- a/clapper_src/player.js +++ b/clapper_src/player.js @@ -618,6 +618,7 @@ class ClapperPlayer extends PlayerBase clapperWidget._saveWindowSize(size); } } + clapperWidget.controls._onCloseRequest(); if(this.state === GstPlayer.PlayerState.STOPPED) return window.run_dispose();