Prevent hiding OSD when menu popover is open

This commit is contained in:
Rafał Dzięgiel
2021-02-19 11:48:10 +01:00
parent dbfd97d11a
commit 12b38702ab

View File

@@ -209,12 +209,13 @@ class ClapperHeaderBarPopover extends Gtk.PopoverMenu
menu_model: model, menu_model: model,
}); });
this.connect('map', this._onMap.bind(this));
this.connect('closed', this._onClosed.bind(this)); this.connect('closed', this._onClosed.bind(this));
} }
_onClosed() _onMap()
{ {
const { child } = this.get_root(); const { child } = this.root;
if( if(
!child !child
@@ -223,6 +224,24 @@ class ClapperHeaderBarPopover extends Gtk.PopoverMenu
) )
return; return;
child.revealControls();
child.isPopoverOpen = true;
}
_onClosed()
{
const { child } = this.root;
if(
!child
|| !child.player
|| !child.player.widget
)
return;
child.revealControls();
child.isPopoverOpen = false;
child.player.widget.grab_focus(); child.player.widget.grab_focus();
} }
}); });