From 1e948b251d63cb9141ff71d24fbcf343d38c7da4 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 16 Sep 2014 14:28:58 +0600 Subject: Fix T41818: Missing refresh on Undo for nodes (mask example) Added a special notifier now NC_WM|ND_UNDO in order to deal with such cases and now compositor/image will refresh when undo happens. There are much more ways to fail compo to update the resul, like undoing while it's not visible and so, but as mont29 said -- let's at least fix obvious crap in the workflow. --- source/blender/editors/space_image/space_image.c | 6 ++++++ source/blender/editors/space_node/space_node.c | 8 ++++++++ source/blender/editors/util/undo.c | 1 + 3 files changed, 15 insertions(+) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 375a0ddeac3..ffe9f13af3f 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -539,6 +539,12 @@ static void image_listener(bScreen *sc, ScrArea *sa, wmNotifier *wmn) } break; } + case NC_WM: + if(wmn->data == ND_UNDO) { + ED_area_tag_redraw(sa); + ED_area_tag_refresh(sa); + } + break; } } diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 9eaee60bfce..875639da113 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -420,6 +420,9 @@ static void node_area_listener(bScreen *sc, ScrArea *sa, wmNotifier *wmn) } } break; + case ND_LAYER_CONTENT: + ED_area_tag_refresh(sa); + break; } break; @@ -507,6 +510,11 @@ static void node_area_listener(bScreen *sc, ScrArea *sa, wmNotifier *wmn) ED_area_tag_refresh(sa); } break; + case NC_WM: + if(wmn->data == ND_UNDO) { + ED_area_tag_refresh(sa); + } + break; } } diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 9461010f49f..189a938e3d8 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -213,6 +213,7 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) } WM_event_add_notifier(C, NC_WINDOW, NULL); + WM_event_add_notifier(C, NC_WM | ND_UNDO, NULL); if (win) { win->addmousemove = true; -- cgit v1.2.3