WM: restart auto-save timer when saving manually

When auto-save is slow it can be very intrusive because it freezes Blender at
unexpected times. Often people have a habit of saving frequently anyway, even
more often than auto-save would. In this case it seems unnecessary to auto-save
as well.

This patch restarts the auto-save timer when the user is saving manually to avoid
the unexpected freeze in many cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/117690
This commit is contained in:
Jacques Lucke
2024-01-31 12:35:56 +01:00
parent dca80b9bc2
commit f0f304e240

View File

@@ -3405,6 +3405,12 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
}
WM_event_add_notifier(C, NC_WM | ND_FILESAVE, nullptr);
if (wmWindowManager *wm = CTX_wm_manager(C)) {
/* Restart auto-save timer to avoid unnecessary unexpected freezing (because of auto-save) when
* often saving manually. */
wm_autosave_timer_end(wm);
wm_autosave_timer_begin(wm);
}
if (!is_save_as && RNA_boolean_get(op->ptr, "exit")) {
wm_exit_schedule_delayed(C);