[gtk/matthiasc/for-master] modelbutton: Be focusable



commit 28b91a44507811ab3ce5f88e347debe853a77590
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Dec 27 21:58:54 2019 -0500

    modelbutton: Be focusable
    
    This got lost when modelbuttons stopped being
    derived from buttons. It is necessary, since
    the GTK focus machinery takes this flag seriously
    nowadays, and won't let us grab focus to non-focusable
    widgets.

 gtk/gtkmodelbutton.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index b40b30c9ce..36d4105fea 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -1378,6 +1378,8 @@ gtk_model_button_init (GtkModelButton *self)
   GtkEventController *controller;
   GtkGesture *gesture;
 
+  gtk_widget_set_can_focus (GTK_WIDGET (self), TRUE);
+
   self->role = GTK_BUTTON_ROLE_NORMAL;
   self->label = gtk_label_new ("");
   gtk_widget_set_halign (self->label, GTK_ALIGN_START);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]