mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
Set popover parent only once and unset on app close
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
10
clapper_src/controls.js
vendored
10
clapper_src/controls.js
vendored
@@ -467,4 +467,14 @@ class ClapperControls extends Gtk.Box
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_onCloseRequest()
|
||||
{
|
||||
for(let button of this.buttonsArr) {
|
||||
if(!button._onCloseRequest)
|
||||
continue;
|
||||
|
||||
button._onCloseRequest();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -618,6 +618,7 @@ class ClapperPlayer extends PlayerBase
|
||||
clapperWidget._saveWindowSize(size);
|
||||
}
|
||||
}
|
||||
clapperWidget.controls._onCloseRequest();
|
||||
|
||||
if(this.state === GstPlayer.PlayerState.STOPPED)
|
||||
return window.run_dispose();
|
||||
|
Reference in New Issue
Block a user