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>2019-04-19 13:42:09 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-19 13:44:28 +0300
commit60d733c5631666201393d950131581d22c4832ab (patch)
tree2a0ae0420e24fb742c1aaa88c7faf84a04857c69 /source/blender
parent98e2713e9417c1c4a76f63076bbfd816131df2bd (diff)
Fix/workaround crash using ED_area_do_msg_notify_tag_redraw
Temporary workaround for crash when refreshing the active tool. Currently ED_region_tag_redraw fails, use notifiers until this is resolved.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/include/ED_screen.h3
-rw-r--r--source/blender/editors/screen/area.c34
2 files changed, 19 insertions, 18 deletions
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index b4349ff6cc7..5d9c493737c 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -131,9 +131,6 @@ bool ED_region_snap_size_apply(struct ARegion *ar, int snap_flag);
void ED_region_do_msg_notify_tag_redraw(struct bContext *C,
struct wmMsgSubscribeKey *msg_key,
struct wmMsgSubscribeValue *msg_val);
-void ED_area_do_msg_notify_tag_redraw(struct bContext *C,
- struct wmMsgSubscribeKey *msg_key,
- struct wmMsgSubscribeValue *msg_val);
void ED_area_do_msg_notify_tag_refresh(struct bContext *C,
struct wmMsgSubscribeKey *msg_key,
struct wmMsgSubscribeValue *msg_val);
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 250a4171e8a..f0e8fb3fa2f 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -443,26 +443,28 @@ void ED_region_do_msg_notify_tag_redraw(
}
}
}
-/**
- * Use #ED_region_do_msg_notify_tag_redraw where possible, this draws too much typically.
- */
-void ED_area_do_msg_notify_tag_redraw(
+
+void ED_area_do_msg_notify_tag_refresh(
/* Follow wmMsgNotifyFn spec */
bContext *UNUSED(C),
wmMsgSubscribeKey *UNUSED(msg_key),
wmMsgSubscribeValue *msg_val)
{
- ScrArea *sa = msg_val->owner;
- ED_area_tag_redraw(sa);
+ ScrArea *sa = msg_val->user_data;
+ ED_area_tag_refresh(sa);
}
-void ED_area_do_msg_notify_tag_refresh(
+
+static void region_do_msg_notify_tag_redraw(
/* Follow wmMsgNotifyFn spec */
bContext *UNUSED(C),
wmMsgSubscribeKey *UNUSED(msg_key),
wmMsgSubscribeValue *msg_val)
{
- ScrArea *sa = msg_val->user_data;
- ED_area_tag_refresh(sa);
+ ARegion *ar = msg_val->owner;
+ ED_region_tag_redraw(ar);
+
+ /* FIXME(campbell): shouldn't be needed. */
+ WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, NULL);
}
void ED_area_do_mgs_subscribe_for_tool_header(
@@ -471,15 +473,17 @@ void ED_area_do_mgs_subscribe_for_tool_header(
struct WorkSpace *workspace,
struct Scene *UNUSED(scene),
struct bScreen *UNUSED(screen),
- struct ScrArea *sa,
- struct ARegion *UNUSED(ar),
+ struct ScrArea *UNUSED(sa),
+ struct ARegion *ar,
struct wmMsgBus *mbus)
{
- /* TODO(campbell): investigate why ED_region_do_msg_notify_tag_redraw doesn't work here. */
wmMsgSubscribeValue msg_sub_value_region_tag_redraw = {
- .owner = sa,
- .user_data = sa,
- .notify = ED_area_do_msg_notify_tag_redraw,
+ .owner = ar,
+ .user_data = ar,
+ /* TODO(campbell): investigate why
+ * ED_region_do_msg_notify_tag_redraw doesn't work here. */
+ // .notify = ED_region_do_msg_notify_tag_redraw,
+ .notify = region_do_msg_notify_tag_redraw,
};
WM_msg_subscribe_rna_prop(
mbus, &workspace->id, workspace, WorkSpace, tools, &msg_sub_value_region_tag_redraw);