event-editor/time-selector: Don't change dropdown on callback
The 'update_time' function shouldn't try to update the dropdown, as it is actually invoked by the dropdown itself. This causes a cyclic loop with signal emission. Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1133
This commit is contained in:
@@ -71,14 +71,7 @@ update_time (GcalTimeSelector *selector)
|
|||||||
hour = hour % 12;
|
hour = hour % 12;
|
||||||
|
|
||||||
if (gtk_drop_down_get_selected (GTK_DROP_DOWN (selector->period_dropdown)) == PM)
|
if (gtk_drop_down_get_selected (GTK_DROP_DOWN (selector->period_dropdown)) == PM)
|
||||||
{
|
hour += 12;
|
||||||
g_signal_handlers_block_by_func (selector->period_dropdown, update_time, selector);
|
|
||||||
|
|
||||||
gtk_drop_down_set_selected (GTK_DROP_DOWN (selector->period_dropdown), hour >= 12);
|
|
||||||
hour += 12;
|
|
||||||
|
|
||||||
g_signal_handlers_unblock_by_func (selector->period_dropdown, update_time, selector);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
now = g_date_time_new_now_local ();
|
now = g_date_time_new_now_local ();
|
||||||
|
|||||||
Reference in New Issue
Block a user