diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-15 06:28:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-15 06:28:26 +0400 |
commit | 8572ae89cdc9148fc948f0052e7f12135ba5c664 (patch) | |
tree | 59952812b49a052aaa29bc7109d01d312a4c6e1c /source/blender/editors/util/undo.c | |
parent | 77a15aba38f00cd2694bb7c463057cada0690e50 (diff) |
UI: fix for glitch where active button became inactive on undo
Diffstat (limited to 'source/blender/editors/util/undo.c')
-rw-r--r-- | source/blender/editors/util/undo.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 6d3d33f1897..af524fa18bc 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -121,14 +121,17 @@ void ED_undo_push(bContext *C, const char *str) /* note: also check undo_history_exec() in bottom if you change notifiers */ static int ed_undo_step(bContext *C, int step, const char *undoname) -{ +{ + wmWindowManager *wm = CTX_wm_manager(C); + wmWindow *win = CTX_wm_window(C); + Scene *scene = CTX_data_scene(C); Object *obedit = CTX_data_edit_object(C); Object *obact = CTX_data_active_object(C); ScrArea *sa = CTX_wm_area(C); /* undo during jobs are running can easily lead to freeing data using by jobs, * or they can just lead to freezing job in some other cases */ - if (WM_jobs_test(CTX_wm_manager(C), CTX_data_scene(C), WM_JOB_TYPE_ANY)) { + if (WM_jobs_test(wm, scene, WM_JOB_TYPE_ANY)) { return OPERATOR_CANCELLED; } @@ -182,9 +185,9 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) } else if (obact && obact->mode & OB_MODE_PARTICLE_EDIT) { if (step == 1) - PE_undo(CTX_data_scene(C)); + PE_undo(scene); else - PE_redo(CTX_data_scene(C)); + PE_redo(scene); } else if (U.uiflag & USER_GLOBALUNDO) { // note python defines not valid here anymore. @@ -202,12 +205,18 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) BKE_undo_name(C, undoname); else BKE_undo_step(C, step); + + scene = CTX_data_scene(C); - WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, CTX_data_scene(C)); + WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene); } } WM_event_add_notifier(C, NC_WINDOW, NULL); + + if (win) { + win->addmousemove = true; + } return OPERATOR_FINISHED; } |