diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-01-27 09:33:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-01-27 09:34:44 +0300 |
commit | f6ff8f27e35d7b9596bbb2c55c3cf464f6e6ffc0 (patch) | |
tree | 2c3ad3131f46596a852f0aab2063475ed791d9c0 /source/blender/windowmanager | |
parent | 499bde810598b69f9ceca9b7456bdca70d28d28b (diff) |
WM: Support showing reports for modal operators
This isn't common use, but modal operators may make reports while they're running.
Now they're displayed in the info header.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 3ff7ef1a42b..84d6f7e9209 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1691,8 +1691,15 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand if (ot->flag & OPTYPE_UNDO) wm->op_undo_depth--; - if (retval & (OPERATOR_CANCELLED | OPERATOR_FINISHED)) + if (retval & (OPERATOR_CANCELLED | OPERATOR_FINISHED)) { wm_operator_reports(C, op, retval, false); + } + else { + /* not very common, but modal operators may report before finishing */ + if (!BLI_listbase_is_empty(&op->reports->list)) { + wm_add_reports(op->reports); + } + } /* important to run 'wm_operator_finished' before NULLing the context members */ if (retval & OPERATOR_FINISHED) { |