From: Caolán McNamara Date: Wed, 18 May 2022 11:40:40 +0000 (+0100) Subject: Allow selectable labels contents to be selected by mnemonic X-Git-Tag: archive/raspbian/4.8.3+ds-2+rpi1~3^2~20^2~4^2~179^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3f49d335d15728c43913780c8b02d7c8fcb48042;p=gtk4.git Allow selectable labels contents to be selected by mnemonic expecially by the mnemonic of another label that targets it. https://gitlab.gnome.org/GNOME/gtk/-/issues/4927 see also https://bugs.documentfoundation.org/show_bug.cgi?id=137748 --- diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index ac25549370..46a909c794 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -2020,6 +2020,12 @@ gtk_label_mnemonic_activate (GtkWidget *widget, if (self->mnemonic_widget) return gtk_widget_mnemonic_activate (self->mnemonic_widget, group_cycling); + /* Not a label for something else, but is selectable, so set focus into + * the label itself. + */ + if (gtk_label_get_selectable (self) && gtk_widget_get_focusable (widget)) + return gtk_label_grab_focus (widget); + /* Try to find the widget to activate by traversing the * widget's ancestry. */