Fix T58439: Info Editor does not show operator reports immediately when

operator cancelled.

Lots of operators return OPERATOR_CANCELLED when no data really changed.
Reports from those operators do not show immediately in the Info Editor
[they only do if the operator returns OPERATOR_FINISHED].

Now also notify the Info Editor in case of OPERATOR_CANCELLED.

Maniphest Tasks: T58439

Differential Revision: https://developer.blender.org/D7238
This commit is contained in:
Philipp Oeser 2020-03-26 10:11:11 +01:00
parent 3b59c11182
commit 6eb1004d50
Notes: blender-bot 2023-02-14 05:51:15 +01:00
Referenced by issue #58439, delay in info editor
1 changed files with 4 additions and 0 deletions

View File

@ -870,6 +870,10 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, bool ca
}
}
/* Refresh Info Editor with reports immediately, even if op returned OPERATOR_CANCELLED. */
if ((retval & OPERATOR_CANCELLED) && !BLI_listbase_is_empty(&op->reports->list)) {
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
}
/* if the caller owns them, handle this */
wm_add_reports(op->reports);
}