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:
authorCampbell Barton <ideasman42@gmail.com>2018-09-13 16:38:53 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-09-13 16:38:53 +0300
commita2325495f919b37c9224c67712599099ec789ebb (patch)
tree3d2614e9aabbd170c38f5a1845e8ec81ac71296e /source/blender/editors/undo
parente082fc7c77235e46a3782e81a255be644a089e7d (diff)
parent1a4aca1b6941a7cede14f2efc68c83fde20ba972 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/undo')
-rw-r--r--source/blender/editors/undo/ed_undo.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c
index 279f3e7cf38..515e96db25d 100644
--- a/source/blender/editors/undo/ed_undo.c
+++ b/source/blender/editors/undo/ed_undo.c
@@ -112,7 +112,6 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
{
CLOG_INFO(&LOG, 1, "name='%s', step=%d", undoname, step);
wmWindowManager *wm = CTX_wm_manager(C);
- wmWindow *win = CTX_wm_window(C);
Scene *scene = CTX_data_scene(C);
ScrArea *sa = CTX_wm_area(C);
@@ -199,10 +198,6 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
Main *bmain = CTX_data_main(C);
WM_toolsystem_refresh_screen_all(bmain);
- if (win) {
- win->addmousemove = true;
- }
-
return OPERATOR_FINISHED;
}
@@ -280,7 +275,12 @@ static int ed_undo_exec(bContext *C, wmOperator *UNUSED(op))
{
/* "last operator" should disappear, later we can tie this with undo stack nicer */
WM_operator_stack_clear(CTX_wm_manager(C));
- return ed_undo_step(C, 1, NULL);
+ int ret = ed_undo_step(C, 1, NULL);
+ if (ret & OPERATOR_FINISHED) {
+ /* Keep button under the cursor active. */
+ WM_event_add_mousemove(C);
+ }
+ return ret;
}
static int ed_undo_push_exec(bContext *C, wmOperator *op)
@@ -293,14 +293,24 @@ static int ed_undo_push_exec(bContext *C, wmOperator *op)
static int ed_redo_exec(bContext *C, wmOperator *UNUSED(op))
{
- return ed_undo_step(C, -1, NULL);
+ int ret = ed_undo_step(C, -1, NULL);
+ if (ret & OPERATOR_FINISHED) {
+ /* Keep button under the cursor active. */
+ WM_event_add_mousemove(C);
+ }
+ return ret;
}
static int ed_undo_redo_exec(bContext *C, wmOperator *UNUSED(op))
{
wmOperator *last_op = WM_operator_last_redo(C);
- const int ret = ED_undo_operator_repeat(C, last_op);
- return ret ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
+ int ret = ED_undo_operator_repeat(C, last_op);
+ ret = ret ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
+ if (ret & OPERATOR_FINISHED) {
+ /* Keep button under the cursor active. */
+ WM_event_add_mousemove(C);
+ }
+ return ret;
}
static bool ed_undo_redo_poll(bContext *C)