[gtk+/wip/baedert/focus: 7/20] widget: Emit ::focus regardless of container-ness and can-focus



commit 658246a1e49cc0ab80eaf0da8571ff2fd10e0d04
Author: Timm Bäder <mail baedert org>
Date:   Wed Feb 8 13:35:23 2017 +0100

    widget: Emit ::focus regardless of container-ness and can-focus

 gtk/gtkwidget.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 4d23586..dd63967 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],


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