From 658246a1e49cc0ab80eaf0da8571ff2fd10e0d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 8 Feb 2017 13:35:23 +0100 Subject: [PATCH] widget: Emit ::focus regardless of container-ness and can-focus --- gtk/gtkwidget.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 4d23586c65..dd63967ba0 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -9481,12 +9481,10 @@ gtk_widget_child_focus (GtkWidget *widget, !gtk_widget_is_sensitive (widget)) return FALSE; - /* child widgets must set CAN_FOCUS, containers - * don't have to though. + /* Emit ::focus in any case, even if can-focus is FALSE, + * since any widget might have child widgets that will take + * focus */ - if (!GTK_IS_CONTAINER (widget) && - !gtk_widget_get_can_focus (widget)) - return FALSE; g_signal_emit (widget, widget_signals[FOCUS],