Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2011-01-19 17:19:20 +0300
committerTon Roosendaal <ton@blender.org>2011-01-19 17:19:20 +0300
commitf49d7d59dc0a83e074e9202a54c22f3c056aa5a6 (patch)
treec8fd6497130413a182bec254cf3d142e670f0ecc /source/blender/windowmanager
parent450288999c74cbef4678e804bbb28d7ebf5752fb (diff)
Bugfix #25652
Report was that move-to-layer menu failed. The real cause was more complex; had to dive deep in the dungeons of the interface code that handled undos and operators. Found several issues: - popup menus (like redo operator, color picker) executed again on a mouse-exit - far too many buttons were sending undo pushes; even worse, in the operator redo-panel each button action was pushed twice - in case operator redo-buttons have own callbacks (like layer buttons) the redo wasn't working - layerbutton menu was called without creating a proper undo/redo case Things should all work smoother now! On todo: - better definition and handling of all versions for operator menus (four types now, not fun) also: make operator "do" menu, which on first action does operator and then switches to redo-ing - bring back Undo menu, to list the undo stack and jump in it.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 0aaa3088142..5aa2f6c1c50 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -981,25 +981,21 @@ static uiBlock *wm_operator_create_ui(bContext *C, ARegion *ar, void *userData)
return block;
}
+/* operator menu needs undo, for redo callback */
int WM_operator_props_popup(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
- int retval= OPERATOR_CANCELLED;
if((op->type->flag & OPTYPE_REGISTER)==0) {
BKE_reportf(op->reports, RPT_ERROR, "Operator '%s' does not have register enabled, incorrect invoke function.", op->type->idname);
return OPERATOR_CANCELLED;
}
- if(op->type->exec) {
- retval= op->type->exec(C, op);
+ ED_undo_push_op(C, op);
+ wm_operator_register(C, op);
- /* ED_undo_push_op(C, op), called by wm_operator_finished now. */
- }
-
- if(retval != OPERATOR_CANCELLED)
- uiPupBlock(C, wm_block_create_redo, op);
+ uiPupBlock(C, wm_block_create_redo, op);
- return retval;
+ return OPERATOR_RUNNING_MODAL;
}
int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, int height)