[gtk/wip/matthiasc/popup: 10/63] widget: Drop the ::focus signal



commit 9a98a373d32a78ab7d4a346a910308dc56b733c7
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Mar 2 13:22:43 2019 -0500

    widget: Drop the ::focus signal
    
    The focus vfunc is an implementation detail
    of GTK focus handling, and having external
    signal handlers interfere with it is not
    a good idea.

 gtk/gtkwidget.c | 27 +--------------------------
 1 file changed, 1 insertion(+), 26 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index bdb3af4c3f..e0b30886ac 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -484,7 +484,6 @@ enum {
   GRAB_NOTIFY,
   CHILD_NOTIFY,
   MNEMONIC_ACTIVATE,
-  FOCUS,
   MOVE_FOCUS,
   KEYNAV_FAILED,
   DRAG_BEGIN,
@@ -1659,23 +1658,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  G_TYPE_BOOLEAN);
 
-  /**
-   * GtkWidget::focus:
-   * @widget: the object which received the signal.
-   * @direction:
-   *
-   * Returns: %TRUE to stop other handlers from being invoked for the event. %FALSE to propagate the event 
further.
-   */
-  widget_signals[FOCUS] =
-    g_signal_new (I_("focus"),
-                 G_TYPE_FROM_CLASS (klass),
-                 G_SIGNAL_RUN_LAST,
-                 G_STRUCT_OFFSET (GtkWidgetClass, focus),
-                 _gtk_boolean_handled_accumulator, NULL,
-                 _gtk_marshal_BOOLEAN__ENUM,
-                 G_TYPE_BOOLEAN, 1,
-                 GTK_TYPE_DIRECTION_TYPE);
-
   /**
    * GtkWidget::move-focus:
    * @widget: the object which received the signal.
@@ -7484,8 +7466,6 @@ gboolean
 gtk_widget_child_focus (GtkWidget       *widget,
                         GtkDirectionType direction)
 {
-  gboolean return_val;
-
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
   if (!_gtk_widget_get_visible (widget) ||
@@ -7497,12 +7477,7 @@ gtk_widget_child_focus (GtkWidget       *widget,
    * focus
    */
 
-  g_signal_emit (widget,
-                widget_signals[FOCUS],
-                0,
-                direction, &return_val);
-
-  return return_val;
+  return GTK_WIDGET_GET_CLASS (widget)->focus (widget, direction);
 }
 
 /**


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