menu_view: don't skip frames after idle

When updating a dialog after a prolonged idle time with no active
animatons, the next _handle_gui_sync would wrongly fast-forward
animations for all the frames passed since the last _handle_gui_sync. On
the PinePhone, this effect is clearly visible when switching between the
main section. The GUI jumps from one state to another instead of
transitioning. This patch solves the issue be resetting '_previous_sync'
when waking up from idle.

Related to issue #5347
This commit is contained in:
Norman Feske 2024-11-07 15:13:32 +01:00
parent f886acdcc6
commit dffa32a72c

View File

@ -265,11 +265,12 @@ void Menu_view::Dialog::_handle_dialog()
_action.hover_changed();
if (!_gui_sync_enabled) {
_previous_sync = _action.now();
_gui.framebuffer.sync_sigh(_gui_sync_handler);
_gui_sync_enabled = true;
}
_handle_gui_sync();
_redraw();
}