From 12b38702ab7afc157f855b02b6fc21aa82f5bb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Fri, 19 Feb 2021 11:48:10 +0100 Subject: [PATCH] Prevent hiding OSD when menu popover is open --- src/headerbarBase.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/headerbarBase.js b/src/headerbarBase.js index 9c93659a..ed59fb02 100644 --- a/src/headerbarBase.js +++ b/src/headerbarBase.js @@ -209,12 +209,13 @@ class ClapperHeaderBarPopover extends Gtk.PopoverMenu menu_model: model, }); + this.connect('map', this._onMap.bind(this)); this.connect('closed', this._onClosed.bind(this)); } - _onClosed() + _onMap() { - const { child } = this.get_root(); + const { child } = this.root; if( !child @@ -223,6 +224,24 @@ class ClapperHeaderBarPopover extends Gtk.PopoverMenu ) 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(); } });