From 0bf0c9e7cf7790a405c45d60b963ee2f3893633e Mon Sep 17 00:00:00 2001 From: Isaque Galdino Date: Thu, 23 Feb 2017 12:50:09 -0300 Subject: [PATCH] multi-choice: Fix endless timeout There are two mapped events for each back/forward buttons in this widget: button-press and button-release. When you reach the limits like January and December, button-release is lost, and you don't get it anymore. That caused button_timeout function to not be disable anymore, so it's kept in loop forever. This code fix checks in button_timeout function if any of the back/ forward buttons are still mapped. If not, it prevents from calling button_timout, stopping the loop. https://bugzilla.gnome.org/show_bug.cgi?id=776459 --- src/gcal-multi-choice.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gcal-multi-choice.c b/src/gcal-multi-choice.c index bfcb19e8..6b0ac0e2 100644 --- a/src/gcal-multi-choice.c +++ b/src/gcal-multi-choice.c @@ -187,6 +187,15 @@ button_timeout (gpointer user_data) if (self->click_id == 0) return G_SOURCE_REMOVE; + if (!gtk_widget_get_mapped (self->down_button) && !gtk_widget_get_mapped (self->up_button)) + { + if (self->click_id) + g_source_remove (self->click_id); + self->click_id = 0; + self->active = NULL; + return G_SOURCE_REMOVE; + } + res = button_activate (self, self->active); if (!res) {