[gtk+] widget: Emit ::focus regardless of container-ness and can-focus
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Emit ::focus regardless of container-ness and can-focus
- Date: Fri, 31 Mar 2017 07:55:17 +0000 (UTC)
commit 0d0cb6e192714f4dd86a30a34a5bf24a62d497ca
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 233dd68..ff1527e 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -9486,12 +9486,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]