Drop ::enter/leave-notify-event

These signals are no longer used in GTK+ and have a (not quite
perfect yet) replacement with GtkEventControllerMotion.

If you need to catch the raw events, the generic ::event
signal still works.
This commit is contained in:
Matthias Clasen 2018-01-02 13:37:02 -05:00
parent 06605d54f2
commit f594807c0a
2 changed files with 2 additions and 76 deletions

View File

@ -495,8 +495,6 @@ enum {
MOTION_NOTIFY_EVENT,
KEY_PRESS_EVENT,
KEY_RELEASE_EVENT,
ENTER_NOTIFY_EVENT,
LEAVE_NOTIFY_EVENT,
FOCUS_IN_EVENT,
FOCUS_OUT_EVENT,
GRAB_BROKEN_EVENT,
@ -1006,8 +1004,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
klass->motion_notify_event = gtk_widget_real_motion_event;
klass->key_press_event = gtk_widget_real_key_press_event;
klass->key_release_event = gtk_widget_real_key_release_event;
klass->enter_notify_event = NULL;
klass->leave_notify_event = NULL;
klass->focus_in_event = gtk_widget_real_focus_in_event;
klass->focus_out_event = gtk_widget_real_focus_out_event;
klass->drag_begin = NULL;
@ -2071,64 +2067,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
g_signal_set_va_marshaller (widget_signals[KEY_RELEASE_EVENT], G_TYPE_FROM_CLASS (klass),
_gtk_marshal_BOOLEAN__OBJECTv);
/**
* GtkWidget::enter-notify-event:
* @widget: the object which received the signal
* @event: (type Gdk.EventCrossing): the #GdkEventCrossing which triggered
* this signal.
*
* The ::enter-notify-event will be emitted when the pointer enters
* the @widget's window.
*
* To receive this signal, the #GdkWindow associated to the widget needs
* to enable the #GDK_ENTER_NOTIFY_MASK mask.
*
* This signal will be sent to the grab widget if there is one.
*
* Returns: %TRUE to stop other handlers from being invoked for the event.
* %FALSE to propagate the event further.
*/
widget_signals[ENTER_NOTIFY_EVENT] =
g_signal_new (I_("enter-notify-event"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_DEPRECATED,
G_STRUCT_OFFSET (GtkWidgetClass, enter_notify_event),
_gtk_boolean_handled_accumulator, NULL,
_gtk_marshal_BOOLEAN__OBJECT,
G_TYPE_BOOLEAN, 1,
GDK_TYPE_EVENT);
g_signal_set_va_marshaller (widget_signals[ENTER_NOTIFY_EVENT], G_TYPE_FROM_CLASS (klass),
_gtk_marshal_BOOLEAN__OBJECTv);
/**
* GtkWidget::leave-notify-event:
* @widget: the object which received the signal
* @event: (type Gdk.EventCrossing): the #GdkEventCrossing which triggered
* this signal.
*
* The ::leave-notify-event will be emitted when the pointer leaves
* the @widget's window.
*
* To receive this signal, the #GdkWindow associated to the widget needs
* to enable the #GDK_LEAVE_NOTIFY_MASK mask.
*
* This signal will be sent to the grab widget if there is one.
*
* Returns: %TRUE to stop other handlers from being invoked for the event.
* %FALSE to propagate the event further.
*/
widget_signals[LEAVE_NOTIFY_EVENT] =
g_signal_new (I_("leave-notify-event"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_DEPRECATED,
G_STRUCT_OFFSET (GtkWidgetClass, leave_notify_event),
_gtk_boolean_handled_accumulator, NULL,
_gtk_marshal_BOOLEAN__OBJECT,
G_TYPE_BOOLEAN, 1,
GDK_TYPE_EVENT);
g_signal_set_va_marshaller (widget_signals[LEAVE_NOTIFY_EVENT], G_TYPE_FROM_CLASS (klass),
_gtk_marshal_BOOLEAN__OBJECTv);
/**
* GtkWidget::focus-in-event:
* @widget: the object which received the signal
@ -6309,6 +6247,8 @@ gtk_widget_emit_event_signals (GtkWidget *widget,
case GDK_MAP:
case GDK_UNMAP:
case GDK_CONFIGURE:
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
case GDK_NOTHING:
signal_num = -1;
break;
@ -6327,12 +6267,6 @@ gtk_widget_emit_event_signals (GtkWidget *widget,
case GDK_KEY_RELEASE:
signal_num = KEY_RELEASE_EVENT;
break;
case GDK_ENTER_NOTIFY:
signal_num = ENTER_NOTIFY_EVENT;
break;
case GDK_LEAVE_NOTIFY:
signal_num = LEAVE_NOTIFY_EVENT;
break;
case GDK_FOCUS_CHANGE:
signal_num = event->focus_change.in ? FOCUS_IN_EVENT : FOCUS_OUT_EVENT;
break;

View File

@ -204,10 +204,6 @@ struct _GtkWidget
* the widgets #GdkWindow.
* @key_press_event: Signal emitted when a key is pressed.
* @key_release_event: Signal is emitted when a key is released.
* @enter_notify_event: Signal event will be emitted when the pointer
* enters the widgets window.
* @leave_notify_event: Will be emitted when the pointer leaves the
* widgets window.
* @focus_in_event: Signal emitted when the keyboard focus enters the
* widgets window.
* @focus_out_event: Signal emitted when the keyboard focus leaves the
@ -328,10 +324,6 @@ struct _GtkWidgetClass
GdkEventKey *event);
gboolean (* key_release_event) (GtkWidget *widget,
GdkEventKey *event);
gboolean (* enter_notify_event) (GtkWidget *widget,
GdkEventCrossing *event);
gboolean (* leave_notify_event) (GtkWidget *widget,
GdkEventCrossing *event);
gboolean (* focus_in_event) (GtkWidget *widget,
GdkEventFocus *event);
gboolean (* focus_out_event) (GtkWidget *widget,