diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-03-23 19:31:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-03-23 19:32:13 +0300 |
commit | a7e4268beeda8e49cd93af375b125c72e6f2ac93 (patch) | |
tree | 1df465cc3d9fb35ba999cba2c019bcbf5a1f5209 /source/blender | |
parent | 15af75d79e5a25049d901764d5cf99fea8348f41 (diff) |
UI: restore quit confirmation when dialog disabled
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 1c21069879a..814d8823817 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2166,12 +2166,23 @@ static int wm_exit_blender_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } +static int wm_exit_blender_invoke(bContext *C, wmOperator *op, const wmEvent *event) +{ + if (U.uiflag & USER_QUIT_PROMPT) { + return wm_exit_blender_exec(C, op); + } + else { + return WM_operator_confirm(C, op, event); + } +} + static void WM_OT_quit_blender(wmOperatorType *ot) { ot->name = "Quit Blender"; ot->idname = "WM_OT_quit_blender"; ot->description = "Quit Blender"; + ot->invoke = wm_exit_blender_invoke; ot->exec = wm_exit_blender_exec; } |