summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-01-06 17:52:56 -0500
committerMatthias Clasen <mclasen@redhat.com>2018-01-16 14:14:10 -0500
commit4f3065a5e84d7417ab22cd07816a2521e8b10453 (patch)
tree4ae15127f5e4f5ab465e724f0b04de3cf0ce1ffe
parente733aa43cf74bd79dda0da6bcdb79ea1575ae660 (diff)
downloadgtk+-4f3065a5e84d7417ab22cd07816a2521e8b10453.tar.gz
calendar: Stop using ::focus-out-event
Use the generic ::event signal.
-rw-r--r--gtk/gtkcalendar.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index a745f394e6..0899748f56 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;
}