[gtk/wip/carlosg/input-cleanups: 20/26] gtkwidget: Drop ::grab-notify signal and vfunc
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/carlosg/input-cleanups: 20/26] gtkwidget: Drop ::grab-notify signal and vfunc
- Date: Wed, 24 Jun 2020 18:38:10 +0000 (UTC)
commit 994f32704bf9cd69d078e90e1d7db31ea5398537
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Jun 24 15:40:05 2020 +0200
gtkwidget: Drop ::grab-notify signal and vfunc
We don't expect widgets to react directly to these anymore.
Internally we still reset the controllers.
gtk/gtkwidget.c | 54 ++++++++++--------------------------------------------
gtk/gtkwidget.h | 5 -----
2 files changed, 10 insertions(+), 49 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 0093abb031..af767f318a 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -492,7 +492,6 @@ enum {
UNREALIZE,
STATE_FLAGS_CHANGED,
DIRECTION_CHANGED,
- GRAB_NOTIFY,
MNEMONIC_ACTIVATE,
MOVE_FOCUS,
KEYNAV_FAILED,
@@ -808,9 +807,16 @@ gtk_widget_real_contains (GtkWidget *widget,
&GRAPHENE_POINT_INIT (x, y));
}
-static void
-gtk_widget_real_grab_notify (GtkWidget *widget,
- gboolean was_grabbed)
+/**
+ * _gtk_widget_grab_notify:
+ * @widget: a #GtkWidget
+ * @was_grabbed: whether a grab is now in effect
+ *
+ * Emits the #GtkWidget::grab-notify signal on @widget.
+ **/
+void
+_gtk_widget_grab_notify (GtkWidget *widget,
+ gboolean was_grabbed)
{
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
int i;
@@ -923,7 +929,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
klass->measure = gtk_widget_real_measure;
klass->state_flags_changed = gtk_widget_real_state_flags_changed;
klass->direction_changed = gtk_widget_real_direction_changed;
- klass->grab_notify = gtk_widget_real_grab_notify;
klass->snapshot = gtk_widget_real_snapshot;
klass->mnemonic_activate = gtk_widget_real_mnemonic_activate;
klass->grab_focus = gtk_widget_grab_focus_self;
@@ -1527,31 +1532,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
G_TYPE_NONE, 1,
GTK_TYPE_TEXT_DIRECTION);
- /**
- * GtkWidget::grab-notify:
- * @widget: the object which received the signal
- * @was_grabbed: %FALSE if the widget becomes shadowed, %TRUE
- * if it becomes unshadowed
- *
- * The ::grab-notify signal is emitted when a widget becomes
- * shadowed by a GTK+ grab (not a pointer or keyboard grab) on
- * another widget, or when it becomes unshadowed due to a grab
- * being removed.
- *
- * A widget is shadowed by a gtk_grab_add() when the topmost
- * grab widget in the grab stack of its window group is not
- * its ancestor.
- */
- widget_signals[GRAB_NOTIFY] =
- g_signal_new (I_("grab-notify"),
- G_TYPE_FROM_CLASS (gobject_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (GtkWidgetClass, grab_notify),
- NULL, NULL,
- NULL,
- G_TYPE_NONE, 1,
- G_TYPE_BOOLEAN);
-
/**
* GtkWidget::mnemonic-activate:
* @widget: the object which received the signal.
@@ -4593,20 +4573,6 @@ gtk_widget_activate (GtkWidget *widget)
return FALSE;
}
-/**
- * _gtk_widget_grab_notify:
- * @widget: a #GtkWidget
- * @was_grabbed: whether a grab is now in effect
- *
- * Emits the #GtkWidget::grab-notify signal on @widget.
- **/
-void
-_gtk_widget_grab_notify (GtkWidget *widget,
- gboolean was_grabbed)
-{
- g_signal_emit (widget, widget_signals[GRAB_NOTIFY], 0, was_grabbed);
-}
-
/**
* gtk_widget_grab_focus:
* @widget: a #GtkWidget
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 6a1e52f6b7..5a5b92b501 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -158,9 +158,6 @@ struct _GtkWidget
* see gtk_widget_get_state_flags().
* @direction_changed: Signal emitted when the text direction of a
* widget changes.
- * @grab_notify: Signal emitted when a widget becomes shadowed by a
- * GTK+ grab (not a pointer or keyboard grab) on another widget, or
- * when it becomes unshadowed due to a grab being removed.
* @get_request_mode: This allows a widget to tell its parent container whether
* it prefers to be allocated in %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH or
* %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT mode.
@@ -226,8 +223,6 @@ struct _GtkWidgetClass
GtkStateFlags previous_state_flags);
void (* direction_changed) (GtkWidget *widget,
GtkTextDirection previous_direction);
- void (* grab_notify) (GtkWidget *widget,
- gboolean was_grabbed);
/* size requests */
GtkSizeRequestMode (* get_request_mode) (GtkWidget *widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]