Fix [#22173] Texture nodes update every mouse click
authorMatt Ebb <matt@mke3.net>
Tue, 27 Apr 2010 11:09:52 +0000 (11:09 +0000)
committerMatt Ebb <matt@mke3.net>
Tue, 27 Apr 2010 11:09:52 +0000 (11:09 +0000)
Notifier tweaks

source/blender/editors/space_node/node_select.c
source/blender/editors/space_node/space_node.c

index b690059fc1218f35a733f96b7e7bed4dcd2872af..3ae1efb2f758a84016f6d3416dc75e5016d1e53b 100644 (file)
@@ -112,9 +112,6 @@ static int node_select_exec(bContext *C, wmOperator *op)
        /* perform the select */
        node= node_mouse_select(snode, ar, mval, extend);
 
-       /* need refresh/a notifier vs compo notifier */
-       WM_event_add_notifier(C, NC_SCENE|ND_NODES, NULL); /* Do we need to pass the scene? */
-
        /* WATCH THIS, there are a few other ways to change the active material */
        if(node) {
                if (node->id && ELEM(GS(node->id->name), ID_MA, ID_TE)) {
@@ -191,7 +188,7 @@ static int node_borderselect_exec(bContext *C, wmOperator *op)
                }
        }
        
-       WM_event_add_notifier(C, NC_SCENE|ND_NODES, NULL); /* Do we need to pass the scene? */
+       WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
 
        return OPERATOR_FINISHED;
 }
@@ -267,7 +264,7 @@ static int node_select_all_exec(bContext *C, wmOperator *op)
                        node->flag |= NODE_SELECT;
        }
        
-       WM_event_add_notifier(C, NC_SCENE|ND_NODES, NULL);
+       WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
        return OPERATOR_FINISHED;
 }
 
@@ -307,7 +304,7 @@ static int node_select_linked_to_exec(bContext *C, wmOperator *op)
                        node->flag |= NODE_SELECT;
        }
        
-       WM_event_add_notifier(C, NC_SCENE|ND_NODES, NULL);
+       WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
        return OPERATOR_FINISHED;
 }
 
@@ -347,7 +344,7 @@ static int node_select_linked_from_exec(bContext *C, wmOperator *op)
                        node->flag |= NODE_SELECT;
        }
        
-       WM_event_add_notifier(C, NC_SCENE|ND_NODES, NULL);
+       WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
        return OPERATOR_FINISHED;
 }
 
index bb568c492987a863df02e81dcc83288cca0c6204..3bafcc25f6e85543716018bf960c7550566fe56a 100644 (file)
@@ -199,7 +199,8 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn)
                                ED_area_tag_redraw(sa);
                        break;
                case NC_NODE:
-                       ED_area_tag_refresh(sa);
+                       if (wmn->action == NA_EDITED)
+                               ED_area_tag_refresh(sa);
                        break;
        }
 }