views/month: Cancel active animation before starting new ones
Before, two finger scrolls on mint cinnamon (X11 scroll instead of wayland) caused month view to crash. g_clear_obj... orphan would an animation allowing two animations to exist at once, causing conflict when the orphan continued in the background. The two animations would be generated due to X11's legacy support of both discrete notch scrolling and the two finger smooth scrolling. I replaced g_clear... with cancel_row_offset_animation in snap_to_top_row which ensures that the orphaned animation is dead prior to reassigning variables. Fixes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1616 Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/801>
This commit is contained in:
@@ -531,7 +531,7 @@ snap_to_top_row (GcalMonthView *self)
|
||||
|
||||
animation_target = adw_callback_animation_target_new (animate_row_offset_cb, self, NULL);
|
||||
|
||||
g_clear_object (&self->row_offset_animation);
|
||||
cancel_row_offset_animation (self);
|
||||
self->row_offset_animation = adw_timed_animation_new (GTK_WIDGET (self),
|
||||
self->row_offset,
|
||||
0.0,
|
||||
|
||||
Reference in New Issue
Block a user