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>2020-09-18 10:57:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-09-18 10:57:54 +0300
commitbda6eb1e27b8e2902b1336101f44a71a7be235c7 (patch)
tree01921e9b07fe3a1e00a78aa72240c00c0e8611b3 /source/blender/makesrna/intern/rna_wm.c
parent9a52b30cc0dea448f24f6f0ce6a1aba423d4959a (diff)
Fix T71383: Error setting the windows workspaces from Python
Assigning window variables relied on notifiers that always used the active window, no matter the window being assigned. Pass the current window to the notifier.
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 3e8c469fc31..8c7bcd9b442 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -737,7 +737,8 @@ static void rna_Window_scene_update(bContext *C, PointerRNA *ptr)
BPy_END_ALLOW_THREADS;
# endif
- WM_event_add_notifier(C, NC_SCENE | ND_SCENEBROWSE, win->new_scene);
+ wmWindowManager *wm = CTX_wm_manager(C);
+ WM_event_add_notifier_ex(wm, win, NC_SCENE | ND_SCENEBROWSE, win->new_scene);
if (G.debug & G_DEBUG) {
printf("scene set %p\n", win->new_scene);
@@ -780,7 +781,8 @@ static void rna_Window_workspace_update(bContext *C, PointerRNA *ptr)
/* exception: can't set screens inside of area/region handlers,
* and must use context so notifier gets to the right window */
if (new_workspace) {
- WM_event_add_notifier(C, NC_SCREEN | ND_WORKSPACE_SET, new_workspace);
+ wmWindowManager *wm = CTX_wm_manager(C);
+ WM_event_add_notifier_ex(wm, win, NC_SCREEN | ND_WORKSPACE_SET, new_workspace);
win->workspace_hook->temp_workspace_store = NULL;
}
}
@@ -828,7 +830,8 @@ static void rna_workspace_screen_update(bContext *C, PointerRNA *ptr)
/* exception: can't set screens inside of area/region handlers,
* and must use context so notifier gets to the right window */
if (layout_new) {
- WM_event_add_notifier(C, NC_SCREEN | ND_LAYOUTBROWSE, layout_new);
+ wmWindowManager *wm = CTX_wm_manager(C);
+ WM_event_add_notifier_ex(wm, win, NC_SCREEN | ND_LAYOUTBROWSE, layout_new);
win->workspace_hook->temp_layout_store = NULL;
}
}