diff --git a/ChangeLog b/ChangeLog index 6ea4524078..2f8eea5de8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Jun 10 00:09:06 2004 Matthias Clasen + + * gtk/gtkcalendar.c (gtk_calendar_button_press): Start + spinning before calling arrow_action(), so that a signal + handler triggered from arrow_action() has a chance to + stop the spinning. (#143966, Davyd Madeley) + Wed Jun 9 23:11:23 2004 Matthias Clasen * gtk/gtkstyle.c (_gtk_style_init_for_settings): Fix a diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 6ea4524078..2f8eea5de8 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +Thu Jun 10 00:09:06 2004 Matthias Clasen + + * gtk/gtkcalendar.c (gtk_calendar_button_press): Start + spinning before calling arrow_action(), so that a signal + handler triggered from arrow_action() has a chance to + stop the spinning. (#143966, Davyd Madeley) + Wed Jun 9 23:11:23 2004 Matthias Clasen * gtk/gtkstyle.c (_gtk_style_init_for_settings): Fix a diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 6ea4524078..2f8eea5de8 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +Thu Jun 10 00:09:06 2004 Matthias Clasen + + * gtk/gtkcalendar.c (gtk_calendar_button_press): Start + spinning before calling arrow_action(), so that a signal + handler triggered from arrow_action() has a chance to + stop the spinning. (#143966, Davyd Madeley) + Wed Jun 9 23:11:23 2004 Matthias Clasen * gtk/gtkstyle.c (_gtk_style_init_for_settings): Fix a diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 6ea4524078..2f8eea5de8 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +Thu Jun 10 00:09:06 2004 Matthias Clasen + + * gtk/gtkcalendar.c (gtk_calendar_button_press): Start + spinning before calling arrow_action(), so that a signal + handler triggered from arrow_action() has a chance to + stop the spinning. (#143966, Davyd Madeley) + Wed Jun 9 23:11:23 2004 Matthias Clasen * gtk/gtkstyle.c (_gtk_style_init_for_settings): Fix a diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 8c408e4e59..544775c1ae 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -328,6 +328,8 @@ static gint gtk_calendar_scroll (GtkWidget *widget, GdkEventScroll *event); static void gtk_calendar_grab_notify (GtkWidget *widget, gboolean was_grabbed); +static gboolean gtk_calendar_focus_out (GtkWidget *widget, + GdkEventFocus *event); static void gtk_calendar_state_changed (GtkWidget *widget, GtkStateType previous_state); static void gtk_calendar_style_set (GtkWidget *widget, @@ -443,6 +445,7 @@ gtk_calendar_class_init (GtkCalendarClass *class) widget_class->style_set = gtk_calendar_style_set; widget_class->state_changed = gtk_calendar_state_changed; widget_class->grab_notify = gtk_calendar_grab_notify; + widget_class->focus_out_event = gtk_calendar_focus_out; widget_class->drag_data_get = gtk_calendar_drag_data_get; widget_class->drag_motion = gtk_calendar_drag_motion; @@ -2722,6 +2725,21 @@ gtk_calendar_grab_notify (GtkWidget *widget, stop_spinning (widget); } +static gboolean +gtk_calendar_focus_out (GtkWidget *widget, + GdkEventFocus *event) +{ + GtkCalendarPrivateData *private_data; + + private_data = GTK_CALENDAR_PRIVATE_DATA (widget); + + stop_spinning (widget); + + private_data->in_drag = 0; + + return FALSE; +} + static gboolean gtk_calendar_button_press (GtkWidget *widget, GdkEventButton *event) @@ -2747,10 +2765,10 @@ gtk_calendar_button_press (GtkWidget *widget, /* only call the action on single click, not double */ if (event->type == GDK_BUTTON_PRESS) { - arrow_action (calendar, arrow); - if (event->button == 1) start_spinning (widget, arrow); + + arrow_action (calendar, arrow); } return TRUE;