[Bf-blender-cvs] [6eb1004d50b] master: Fix T58439: Info Editor does not show operator reports immediately when operator cancelled.

Philipp Oeser noreply at git.blender.org
Fri Mar 27 09:50:11 CET 2020


Commit: 6eb1004d50b8b80c67fd867efae8c3a66f5f0cec
Author: Philipp Oeser
Date:   Thu Mar 26 10:11:11 2020 +0100
Branches: master
https://developer.blender.org/rB6eb1004d50b8b80c67fd867efae8c3a66f5f0cec

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

===================================================================

M	source/blender/windowmanager/intern/wm_event_system.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index b61759e6d97..1a794e9bf0b 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -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);
 }



More information about the Bf-blender-cvs mailing list