From fe30ba24fa5d406d4e75f71ddee5aac0d6577e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Sat, 18 Jan 2025 18:31:03 +0100 Subject: [PATCH] clapper-gtk: extra-menu-button: Drop popover focus on unmap Fixes #496 --- src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c b/src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c index 16bd1d98..53a7513d 100644 --- a/src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c +++ b/src/lib/clapper-gtk/clapper-gtk-extra-menu-button.c @@ -574,6 +574,8 @@ popover_map_cb (GtkWidget *widget, ClapperGtkExtraMenuButton *self) GST_TRACE_OBJECT (self, "Popover map"); + gtk_widget_set_can_focus (widget, TRUE); + if (G_UNLIKELY (self->player == NULL)) return; @@ -608,6 +610,11 @@ popover_unmap_cb (GtkWidget *widget, ClapperGtkExtraMenuButton *self) GST_TRACE_OBJECT (self, "Popover unmap"); + /* Drop focus after popover is closed. Fixes issue + * with keyboard shortcuts not working when closed + * while within submenu */ + gtk_widget_set_can_focus (widget, FALSE); + if (G_UNLIKELY (self->player == NULL)) return;