[gtk+/wip/matthiasc/kill-event-signals: 113/123] calendar: Stop using ::focus-out-event
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/matthiasc/kill-event-signals: 113/123] calendar: Stop using ::focus-out-event
- Date: Wed, 10 Jan 2018 23:37:03 +0000 (UTC)
commit 8cde96594c235ec3a98507c4092732dfd7dde91a
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jan 6 17:52:56 2018 -0500
calendar: Stop using ::focus-out-event
Use the generic ::event signal.
gtk/gtkcalendar.c | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index a745f39..0899748 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -297,8 +297,8 @@ static void gtk_calendar_drag_update (GtkGestureDrag *gesture,
gpointer data);
static gboolean gtk_calendar_key_press (GtkWidget *widget,
GdkEventKey *event);
-static gboolean gtk_calendar_focus_out (GtkWidget *widget,
- GdkEventFocus *event);
+static gboolean gtk_calendar_event (GtkWidget *widget,
+ GdkEvent *event);
static void gtk_calendar_grab_notify (GtkWidget *widget,
gboolean was_grabbed);
static void gtk_calendar_state_flags_changed (GtkWidget *widget,
@@ -377,7 +377,7 @@ gtk_calendar_class_init (GtkCalendarClass *class)
widget_class->key_press_event = gtk_calendar_key_press;
widget_class->state_flags_changed = gtk_calendar_state_flags_changed;
widget_class->grab_notify = gtk_calendar_grab_notify;
- widget_class->focus_out_event = gtk_calendar_focus_out;
+ widget_class->event = gtk_calendar_event;
widget_class->query_tooltip = gtk_calendar_query_tooltip;
widget_class->drag_data_get = gtk_calendar_drag_data_get;
@@ -2886,17 +2886,20 @@ gtk_calendar_grab_notify (GtkWidget *widget,
}
static gboolean
-gtk_calendar_focus_out (GtkWidget *widget,
- GdkEventFocus *event)
+gtk_calendar_event (GtkWidget *widget,
+ GdkEvent *event)
{
GtkCalendar *calendar = GTK_CALENDAR (widget);
- calendar_queue_refresh (calendar);
- calendar_stop_spinning (calendar);
+ if (gdk_event_get_event_type (event) == GDK_FOCUS_CHANGE)
+ {
+ calendar_queue_refresh (calendar);
+ calendar_stop_spinning (calendar);
- calendar->priv->in_drag = 0;
+ calendar->priv->in_drag = 0;
+ }
- return FALSE;
+ return GDK_EVENT_PROPAGATE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]