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:
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_screen.h4
-rw-r--r--source/blender/editors/include/ED_screen.h4
-rw-r--r--source/blender/editors/interface/interface_templates.c2
-rw-r--r--source/blender/editors/screen/area.c8
-rw-r--r--source/blender/editors/space_action/space_action.c8
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c4
-rw-r--r--source/blender/editors/space_clip/space_clip.c14
-rw-r--r--source/blender/editors/space_console/space_console.c2
-rw-r--r--source/blender/editors/space_file/space_file.c8
-rw-r--r--source/blender/editors/space_graph/space_graph.c4
-rw-r--r--source/blender/editors/space_image/space_image.c10
-rw-r--r--source/blender/editors/space_info/space_info.c4
-rw-r--r--source/blender/editors/space_logic/space_logic.c2
-rw-r--r--source/blender/editors/space_nla/space_nla.c8
-rw-r--r--source/blender/editors/space_node/node_draw.c6
-rw-r--r--source/blender/editors/space_node/space_node.c4
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c4
-rw-r--r--source/blender/editors/space_script/space_script.c2
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c8
-rw-r--r--source/blender/editors/space_text/space_text.c2
-rw-r--r--source/blender/editors/space_time/space_time.c6
-rw-r--r--source/blender/editors/space_userpref/space_userpref.c4
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c22
-rw-r--r--source/blender/makesrna/intern/rna_material.c12
-rw-r--r--source/blender/windowmanager/WM_types.h1
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c44
26 files changed, 105 insertions, 92 deletions
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index 5407e22e49e..b5a6c6fb821 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -78,7 +78,7 @@ typedef struct SpaceType {
/* exit is called when the area is hidden or removed */
void (*exit)(struct wmWindowManager *, struct ScrArea *);
/* Listeners can react to bContext changes */
- void (*listener)(struct ScrArea *, struct wmNotifier *);
+ void (*listener)(struct bScreen *sc, struct ScrArea *, struct wmNotifier *);
/* refresh context, called after filereads, ED_area_tag_refresh() */
void (*refresh)(const struct bContext *, struct ScrArea *);
@@ -123,7 +123,7 @@ typedef struct ARegionType {
/* draw entirely, view changes should be handled here */
void (*draw)(const struct bContext *, struct ARegion *);
/* contextual changes should be handled here */
- void (*listener)(struct ARegion *, struct wmNotifier *);
+ void (*listener)(struct bScreen *sc, struct ScrArea *, struct ARegion *, struct wmNotifier *);
void (*free)(struct ARegion *);
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index 12030f7da80..d80e40d2455 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -50,7 +50,7 @@ struct uiBlock;
struct rcti;
/* regions */
-void ED_region_do_listen(struct ARegion *ar, struct wmNotifier *note);
+void ED_region_do_listen(struct bScreen *sc, struct ScrArea *sa, struct ARegion *ar, struct wmNotifier *note);
void ED_region_do_draw(struct bContext *C, struct ARegion *ar);
void ED_region_exit(struct bContext *C, struct ARegion *ar);
void ED_region_pixelspace(struct ARegion *ar);
@@ -80,7 +80,7 @@ int ED_area_header_standardbuttons(const struct bContext *C, struct uiBlock
void ED_area_initialize(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *sa);
void ED_area_exit(struct bContext *C, struct ScrArea *sa);
int ED_screen_area_active(const struct bContext *C);
-void ED_area_do_listen(ScrArea *sa, struct wmNotifier *note);
+void ED_area_do_listen(struct bScreen *sc, ScrArea *sa, struct wmNotifier *note);
void ED_area_tag_redraw(ScrArea *sa);
void ED_area_tag_redraw_regiontype(ScrArea *sa, int type);
void ED_area_tag_refresh(ScrArea *sa);
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 464fcfb0496..34d1c24aade 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -1284,7 +1284,7 @@ static void do_preview_buttons(bContext *C, void *arg, int event)
{
switch (event) {
case B_MATPRV:
- WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING, arg);
+ WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_PREVIEW, arg);
break;
}
}
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 429156ea6a7..4ddacc3254e 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -116,7 +116,7 @@ void ED_region_pixelspace(ARegion *ar)
}
/* only exported for WM */
-void ED_region_do_listen(ARegion *ar, wmNotifier *note)
+void ED_region_do_listen(bScreen *sc, ScrArea *sa, ARegion *ar, wmNotifier *note)
{
/* generic notes first */
switch (note->category) {
@@ -130,15 +130,15 @@ void ED_region_do_listen(ARegion *ar, wmNotifier *note)
}
if (ar->type && ar->type->listener)
- ar->type->listener(ar, note);
+ ar->type->listener(sc, sa, ar, note);
}
/* only exported for WM */
-void ED_area_do_listen(ScrArea *sa, wmNotifier *note)
+void ED_area_do_listen(bScreen *sc, ScrArea *sa, wmNotifier *note)
{
/* no generic notes? */
if (sa->type && sa->type->listener) {
- sa->type->listener(sa, note);
+ sa->type->listener(sc, sa, note);
}
}
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index b2bb455a0ba..7b0ff5a656f 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -269,7 +269,7 @@ static void action_header_area_draw(const bContext *C, ARegion *ar)
ED_region_header(C, ar);
}
-static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn)
+static void action_channel_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -307,7 +307,7 @@ static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn)
}
}
-static void action_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void action_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -355,7 +355,7 @@ static void action_main_area_listener(ARegion *ar, wmNotifier *wmn)
}
/* editor level listener */
-static void action_listener(ScrArea *sa, wmNotifier *wmn)
+static void action_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
{
SpaceAction *saction = (SpaceAction *)sa->spacedata.first;
@@ -448,7 +448,7 @@ static void action_listener(ScrArea *sa, wmNotifier *wmn)
}
}
-static void action_header_area_listener(ARegion *ar, wmNotifier *wmn)
+static void action_header_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index e6c6df416bf..b01f653837c 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -225,7 +225,7 @@ static void buttons_area_redraw(ScrArea *sa, short buttons)
}
/* reused! */
-static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
+static void buttons_area_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
{
SpaceButs *sbuts = sa->spacedata.first;
@@ -295,6 +295,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
case ND_SHADING:
case ND_SHADING_DRAW:
case ND_SHADING_LINKS:
+ case ND_SHADING_PREVIEW:
/* currently works by redraws... if preview is set, it (re)starts job */
sbuts->preview = 1;
break;
@@ -318,6 +319,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
case ND_SHADING:
case ND_SHADING_DRAW:
case ND_SHADING_LINKS:
+ case ND_SHADING_PREVIEW:
case ND_NODES:
/* currently works by redraws... if preview is set, it (re)starts job */
sbuts->preview = 1;
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index 986b71abc8a..36cf9fc44c6 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -340,7 +340,7 @@ static SpaceLink *clip_duplicate(SpaceLink *sl)
return (SpaceLink *)scn;
}
-static void clip_listener(ScrArea *sa, wmNotifier *wmn)
+static void clip_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -1174,7 +1174,7 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar)
}
}
-static void clip_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void clip_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -1283,7 +1283,7 @@ static void clip_preview_area_draw(const bContext *C, ARegion *ar)
dopesheet_area_draw(C, ar);
}
-static void clip_preview_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
+static void clip_preview_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
{
}
@@ -1324,7 +1324,7 @@ static void clip_channels_area_draw(const bContext *C, ARegion *ar)
UI_view2d_view_restore(C);
}
-static void clip_channels_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
+static void clip_channels_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
{
}
@@ -1341,7 +1341,7 @@ static void clip_header_area_draw(const bContext *C, ARegion *ar)
ED_region_header(C, ar);
}
-static void clip_header_area_listener(ARegion *ar, wmNotifier *wmn)
+static void clip_header_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -1381,7 +1381,7 @@ static void clip_tools_area_draw(const bContext *C, ARegion *ar)
/****************** tool properties region ******************/
-static void clip_props_area_listener(ARegion *ar, wmNotifier *wmn)
+static void clip_props_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -1426,7 +1426,7 @@ static void clip_properties_area_draw(const bContext *C, ARegion *ar)
ED_region_panels(C, ar, 1, NULL, -1);
}
-static void clip_properties_area_listener(ARegion *ar, wmNotifier *wmn)
+static void clip_properties_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index 81211e7bfef..88a04197847 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -359,7 +359,7 @@ static void console_header_area_draw(const bContext *C, ARegion *ar)
ED_region_header(C, ar);
}
-static void console_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void console_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
// SpaceInfo *sinfo = sa->spacedata.first;
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 56b0a5481bf..8b1df0f0d8f 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -255,7 +255,7 @@ static void file_refresh(const bContext *C, ScrArea *UNUSED(sa))
}
-static void file_listener(ScrArea *sa, wmNotifier *wmn)
+static void file_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
{
/* SpaceFile *sfile = (SpaceFile *)sa->spacedata.first; */
@@ -291,7 +291,7 @@ static void file_main_area_init(wmWindowManager *wm, ARegion *ar)
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}
-static void file_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void file_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -500,7 +500,7 @@ static void file_channel_area_draw(const bContext *C, ARegion *ar)
ED_region_panels(C, ar, 1, NULL, -1);
}
-static void file_channel_area_listener(ARegion *UNUSED(ar), wmNotifier *wmn)
+static void file_channel_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar), wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -560,7 +560,7 @@ static void file_ui_area_draw(const bContext *C, ARegion *ar)
UI_view2d_view_restore(C);
}
-static void file_ui_area_listener(ARegion *ar, wmNotifier *wmn)
+static void file_ui_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 1a208ee2eb6..6e38f236d01 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -384,7 +384,7 @@ static void graph_buttons_area_draw(const bContext *C, ARegion *ar)
ED_region_panels(C, ar, 1, NULL, -1);
}
-static void graph_region_listener(ARegion *ar, wmNotifier *wmn)
+static void graph_region_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -438,7 +438,7 @@ static void graph_region_listener(ARegion *ar, wmNotifier *wmn)
}
/* editor level listener */
-static void graph_listener(ScrArea *sa, wmNotifier *wmn)
+static void graph_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
{
SpaceIpo *sipo = (SpaceIpo *)sa->spacedata.first;
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 679c1632eb1..fd57bf6101f 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -420,7 +420,7 @@ static void image_refresh(const bContext *C, ScrArea *sa)
}
}
-static void image_listener(ScrArea *sa, wmNotifier *wmn)
+static void image_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
{
SpaceImage *sima = (SpaceImage *)sa->spacedata.first;
@@ -731,7 +731,7 @@ static void image_main_area_draw(const bContext *C, ARegion *ar)
#endif
}
-static void image_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void image_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -765,7 +765,7 @@ static void image_buttons_area_draw(const bContext *C, ARegion *ar)
ED_region_panels(C, ar, 1, NULL, -1);
}
-static void image_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
+static void image_buttons_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -821,7 +821,7 @@ static void image_scope_area_draw(const bContext *C, ARegion *ar)
ED_region_panels(C, ar, 1, NULL, -1);
}
-static void image_scope_area_listener(ARegion *ar, wmNotifier *wmn)
+static void image_scope_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -858,7 +858,7 @@ static void image_header_area_draw(const bContext *C, ARegion *ar)
ED_region_header(C, ar);
}
-static void image_header_area_listener(ARegion *ar, wmNotifier *wmn)
+static void image_header_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
index 96ad6dee2df..10b935502ba 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -233,7 +233,7 @@ static void info_header_area_draw(const bContext *C, ARegion *ar)
ED_region_header(C, ar);
}
-static void info_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void info_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
// SpaceInfo *sinfo = sa->spacedata.first;
@@ -248,7 +248,7 @@ static void info_main_area_listener(ARegion *ar, wmNotifier *wmn)
}
}
-static void info_header_listener(ARegion *ar, wmNotifier *wmn)
+static void info_header_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c
index 3f3c81f2bfa..4682bbc59ff 100644
--- a/source/blender/editors/space_logic/space_logic.c
+++ b/source/blender/editors/space_logic/space_logic.c
@@ -194,7 +194,7 @@ static void logic_refresh(const bContext *UNUSED(C), ScrArea *UNUSED(sa))
}
-static void logic_listener(ARegion *ar, wmNotifier *wmn)
+static void logic_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index 4ef84b3e708..e54c1e8323a 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -353,7 +353,7 @@ static void nla_buttons_area_draw(const bContext *C, ARegion *ar)
ED_region_panels(C, ar, 1, NULL, -1);
}
-static void nla_region_listener(ARegion *ar, wmNotifier *wmn)
+static void nla_region_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -386,7 +386,7 @@ static void nla_region_listener(ARegion *ar, wmNotifier *wmn)
}
-static void nla_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void nla_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -430,7 +430,7 @@ static void nla_main_area_listener(ARegion *ar, wmNotifier *wmn)
}
}
-static void nla_channel_area_listener(ARegion *ar, wmNotifier *wmn)
+static void nla_channel_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -465,7 +465,7 @@ static void nla_channel_area_listener(ARegion *ar, wmNotifier *wmn)
}
/* editor level listener */
-static void nla_listener(ScrArea *sa, wmNotifier *wmn)
+static void nla_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 0ed803a7521..7da06bcf3a6 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -119,11 +119,11 @@ void ED_node_tag_update_id(ID *id)
DAG_id_tag_update(id, 0);
if (GS(id->name) == ID_MA)
- WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, id);
+ WM_main_add_notifier(NC_MATERIAL | ND_SHADING, id);
else if (GS(id->name) == ID_LA)
- WM_main_add_notifier(NC_LAMP | ND_LIGHTING_DRAW, id);
+ WM_main_add_notifier(NC_LAMP | ND_LIGHTING, id);
else if (GS(id->name) == ID_WO)
- WM_main_add_notifier(NC_WORLD | ND_WORLD_DRAW, id);
+ WM_main_add_notifier(NC_WORLD | ND_WORLD, id);
}
else if (ntree->type == NTREE_COMPOSIT) {
WM_main_add_notifier(NC_SCENE | ND_NODES, id);
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index d0d74059da8..07fa6997e99 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -377,7 +377,7 @@ static void node_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa))
}
-static void node_area_listener(ScrArea *sa, wmNotifier *wmn)
+static void node_area_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
{
/* note, ED_area_tag_refresh will re-execute compositor */
SpaceNode *snode = sa->spacedata.first;
@@ -682,7 +682,7 @@ static void node_header_area_draw(const bContext *C, ARegion *ar)
}
/* used for header + main area */
-static void node_region_listener(ARegion *ar, wmNotifier *wmn)
+static void node_region_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 9e458647aa2..8da244b1db1 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -262,7 +262,7 @@ static void outliner_main_area_free(ARegion *UNUSED(ar))
}
-static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void outliner_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -378,7 +378,7 @@ static void outliner_header_area_free(ARegion *UNUSED(ar))
{
}
-static void outliner_header_area_listener(ARegion *ar, wmNotifier *wmn)
+static void outliner_header_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c
index a6c4ac231df..fd2cd268a27 100644
--- a/source/blender/editors/space_script/space_script.c
+++ b/source/blender/editors/space_script/space_script.c
@@ -178,7 +178,7 @@ static void script_header_area_draw(const bContext *C, ARegion *ar)
ED_region_header(C, ar);
}
-static void script_main_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
+static void script_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
{
/* context changes */
// XXX - Todo, need the ScriptSpace accessible to get the python script to run.
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 08848645bf9..04b2a21bf79 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -318,7 +318,7 @@ static SpaceLink *sequencer_duplicate(SpaceLink *sl)
return (SpaceLink *)sseqn;
}
-static void sequencer_listener(ScrArea *sa, wmNotifier *wmn)
+static void sequencer_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -480,7 +480,7 @@ static void sequencer_header_area_draw(const bContext *C, ARegion *ar)
ED_region_header(C, ar);
}
-static void sequencer_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void sequencer_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -555,7 +555,7 @@ static void sequencer_preview_area_draw(const bContext *C, ARegion *ar)
}
-static void sequencer_preview_area_listener(ARegion *ar, wmNotifier *wmn)
+static void sequencer_preview_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -612,7 +612,7 @@ static void sequencer_buttons_area_draw(const bContext *C, ARegion *ar)
ED_region_panels(C, ar, 1, NULL, -1);
}
-static void sequencer_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
+static void sequencer_buttons_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 92b6b78e536..e7fa4c05b9d 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -116,7 +116,7 @@ static SpaceLink *text_duplicate(SpaceLink *sl)
return (SpaceLink *)stextn;
}
-static void text_listener(ScrArea *sa, wmNotifier *wmn)
+static void text_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
{
SpaceText *st = sa->spacedata.first;
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 0f798aa1893..8258d717889 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -397,7 +397,7 @@ static void time_refresh(const bContext *UNUSED(C), ScrArea *sa)
}
/* editor level listener */
-static void time_listener(ScrArea *sa, wmNotifier *wmn)
+static void time_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
{
/* mainly for updating cache display */
@@ -523,7 +523,7 @@ static void time_main_area_draw(const bContext *C, ARegion *ar)
UI_view2d_scrollers_free(scrollers);
}
-static void time_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void time_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -563,7 +563,7 @@ static void time_header_area_draw(const bContext *C, ARegion *ar)
ED_region_header(C, ar);
}
-static void time_header_area_listener(ARegion *ar, wmNotifier *wmn)
+static void time_header_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c
index 5ebbebec35b..0bd094b6a33 100644
--- a/source/blender/editors/space_userpref/space_userpref.c
+++ b/source/blender/editors/space_userpref/space_userpref.c
@@ -138,12 +138,12 @@ static void userpref_header_area_draw(const bContext *C, ARegion *ar)
ED_region_header(C, ar);
}
-static void userpref_main_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
+static void userpref_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
{
/* context changes */
}
-static void userpref_header_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
+static void userpref_header_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
{
/* context changes */
#if 0
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index eb7adb7a333..b3d58bfa1b1 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -709,8 +709,10 @@ static void view3d_recalc_used_layers(ARegion *ar, wmNotifier *wmn, Scene *scene
}
}
-static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void view3d_main_area_listener(bScreen *sc, ScrArea *sa, ARegion *ar, wmNotifier *wmn)
{
+ Scene *scene = sc->scene;
+ View3D *v3d = sa->spacedata.first;
/* context changes */
switch (wmn->category) {
@@ -799,6 +801,12 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
break;
case NC_MATERIAL:
switch (wmn->data) {
+ case ND_SHADING:
+ case ND_NODES:
+ if ((v3d->drawtype == OB_MATERIAL) ||
+ (v3d->drawtype == OB_TEXTURE && scene->gm.matmode == GAME_MAT_GLSL))
+ ED_region_tag_redraw(ar);
+ break;
case ND_SHADING_DRAW:
case ND_SHADING_LINKS:
ED_region_tag_redraw(ar);
@@ -822,7 +830,9 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
case NC_LAMP:
switch (wmn->data) {
case ND_LIGHTING_DRAW:
- ED_region_tag_redraw(ar);
+ if ((v3d->drawtype == OB_MATERIAL) ||
+ (v3d->drawtype == OB_TEXTURE && (scene->gm.matmode == GAME_MAT_GLSL)))
+ ED_region_tag_redraw(ar);
break;
}
break;
@@ -907,7 +917,7 @@ static void view3d_header_area_draw(const bContext *C, ARegion *ar)
ED_region_header(C, ar);
}
-static void view3d_header_area_listener(ARegion *ar, wmNotifier *wmn)
+static void view3d_header_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -948,7 +958,7 @@ static void view3d_buttons_area_draw(const bContext *C, ARegion *ar)
ED_region_panels(C, ar, 1, NULL, -1);
}
-static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
+static void view3d_buttons_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -1048,7 +1058,7 @@ static void view3d_tools_area_draw(const bContext *C, ARegion *ar)
ED_region_panels(C, ar, 1, CTX_data_mode_string(C), -1);
}
-static void view3d_props_area_listener(ARegion *ar, wmNotifier *wmn)
+static void view3d_props_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
{
/* context changes */
switch (wmn->category) {
@@ -1068,7 +1078,7 @@ static void view3d_props_area_listener(ARegion *ar, wmNotifier *wmn)
}
/*area (not region) level listener*/
-static void space_view3d_listener(ScrArea *sa, struct wmNotifier *wmn)
+static void space_view3d_listener(bScreen *UNUSED(sc), ScrArea *sa, struct wmNotifier *wmn)
{
View3D *v3d = sa->spacedata.first;
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 8936609c7db..fceb4e0a4d4 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -97,14 +97,7 @@ static void rna_Material_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *p
Material *ma = ptr->id.data;
DAG_id_tag_update(&ma->id, 0);
- if (scene) { /* can be NULL, see [#30025] */
- if (scene->gm.matmode == GAME_MAT_GLSL) {
- WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma);
- }
- else {
- WM_main_add_notifier(NC_MATERIAL | ND_SHADING, ma);
- }
- }
+ WM_main_add_notifier(NC_MATERIAL | ND_SHADING, ma);
}
static void rna_Material_update_previews(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -114,10 +107,9 @@ static void rna_Material_update_previews(Main *bmain, Scene *scene, PointerRNA *
if (ma->nodetree)
BKE_node_preview_clear_tree(ma->nodetree);
- WM_main_add_notifier(NC_MATERIAL | ND_SHADING, ma);
+ WM_main_add_notifier(NC_MATERIAL | ND_SHADING_PREVIEW, ma);
}
-
static void rna_Material_draw_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
{
Material *ma = ptr->id.data;
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index cd3899897a1..f1932c8aa97 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -302,6 +302,7 @@ typedef struct wmNotifier {
#define ND_SHADING (30<<16)
#define ND_SHADING_DRAW (31<<16)
#define ND_SHADING_LINKS (32<<16)
+#define ND_SHADING_PREVIEW (33<<16)
/* NC_LAMP Lamp */
#define ND_LIGHTING (40<<16)
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index ac714b09bb0..0bef59cfc55 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -148,9 +148,15 @@ static int wm_test_duplicate_notifier(wmWindowManager *wm, unsigned int type, vo
void WM_event_add_notifier(const bContext *C, unsigned int type, void *reference)
{
ARegion *ar;
- wmNotifier *note = MEM_callocN(sizeof(wmNotifier), "notifier");
+ wmWindowManager *wm = CTX_wm_manager(C);
+ wmNotifier *note;
+
+ if (wm_test_duplicate_notifier(wm, type, reference))
+ return;
+
+ note = MEM_callocN(sizeof(wmNotifier), "notifier");
- note->wm = CTX_wm_manager(C);
+ note->wm = wm;
BLI_addtail(&note->wm->queue, note);
note->window = CTX_wm_window(C);
@@ -171,20 +177,22 @@ void WM_main_add_notifier(unsigned int type, void *reference)
{
Main *bmain = G.main;
wmWindowManager *wm = bmain->wm.first;
+ wmNotifier *note;
- if (wm && !wm_test_duplicate_notifier(wm, type, reference)) {
- wmNotifier *note = MEM_callocN(sizeof(wmNotifier), "notifier");
-
- note->wm = wm;
- BLI_addtail(&note->wm->queue, note);
-
- note->category = type & NOTE_CATEGORY;
- note->data = type & NOTE_DATA;
- note->subtype = type & NOTE_SUBTYPE;
- note->action = type & NOTE_ACTION;
-
- note->reference = reference;
- }
+ if (!wm || wm_test_duplicate_notifier(wm, type, reference))
+ return;
+
+ note = MEM_callocN(sizeof(wmNotifier), "notifier");
+
+ note->wm = wm;
+ BLI_addtail(&note->wm->queue, note);
+
+ note->category = type & NOTE_CATEGORY;
+ note->data = type & NOTE_DATA;
+ note->subtype = type & NOTE_SUBTYPE;
+ note->action = type & NOTE_ACTION;
+
+ note->reference = reference;
}
/**
@@ -312,13 +320,13 @@ void wm_event_do_notifiers(bContext *C)
ED_screen_do_listen(C, note);
for (ar = win->screen->regionbase.first; ar; ar = ar->next) {
- ED_region_do_listen(ar, note);
+ ED_region_do_listen(win->screen, NULL, ar, note);
}
for (sa = win->screen->areabase.first; sa; sa = sa->next) {
- ED_area_do_listen(sa, note);
+ ED_area_do_listen(win->screen, sa, note);
for (ar = sa->regionbase.first; ar; ar = ar->next) {
- ED_region_do_listen(ar, note);
+ ED_region_do_listen(win->screen, sa, ar, note);
}
}
}