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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user