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:
authorJulian Eisel <julian@blender.org>2020-03-06 18:22:28 +0300
committerJulian Eisel <julian@blender.org>2020-03-06 18:27:13 +0300
commitd5572eacc5958db38ac4a4a32eddb3a2cd24bf68 (patch)
tree5252d8f509dae02bf9c137a1710c073d5bbac592 /source/blender/editors/screen
parentb242cc67928a6858a835c088e4d3ea8822c83168 (diff)
Cleanup: Reduce context usage in UI functions
Part of https://developer.blender.org/T74429. There's a chance that this causes some issues becaue in some cases we change from getting the window from context to getting it from somewhere else.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/area.c9
-rw-r--r--source/blender/editors/screen/screen_edit.c2
-rw-r--r--source/blender/editors/screen/screen_ops.c2
-rw-r--r--source/blender/editors/screen/workspace_edit.c2
4 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 26240482e6d..c6e7b9d382a 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1971,6 +1971,7 @@ void ED_area_data_swap(ScrArea *sa_dst, ScrArea *sa_src)
void ED_area_swapspace(bContext *C, ScrArea *sa1, ScrArea *sa2)
{
ScrArea *tmp = MEM_callocN(sizeof(ScrArea), "addscrarea");
+ wmWindow *win = CTX_wm_window(C);
ED_area_exit(C, sa1);
ED_area_exit(C, sa2);
@@ -1978,14 +1979,14 @@ void ED_area_swapspace(bContext *C, ScrArea *sa1, ScrArea *sa2)
ED_area_data_copy(tmp, sa1, false);
ED_area_data_copy(sa1, sa2, true);
ED_area_data_copy(sa2, tmp, true);
- ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa1);
- ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa2);
+ ED_area_initialize(CTX_wm_manager(C), win, sa1);
+ ED_area_initialize(CTX_wm_manager(C), win, sa2);
BKE_screen_area_free(tmp);
MEM_freeN(tmp);
/* tell WM to refresh, cursor types etc */
- WM_event_add_mousemove(C);
+ WM_event_add_mousemove(win);
ED_area_tag_redraw(sa1);
ED_area_tag_refresh(sa1);
@@ -2119,7 +2120,7 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_ar_exi
ED_area_initialize(CTX_wm_manager(C), win, sa);
/* tell WM to refresh, cursor types etc */
- WM_event_add_mousemove(C);
+ WM_event_add_mousemove(win);
/* send space change notifier */
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_CHANGED, sa);
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index c94c6ca9acb..6c86b05e1c7 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1013,7 +1013,7 @@ void screen_change_update(bContext *C, wmWindow *win, bScreen *sc)
WM_event_add_notifier(C, NC_SCREEN | ND_LAYOUTSET, layout);
/* makes button hilites work */
- WM_event_add_mousemove(C);
+ WM_event_add_mousemove(win);
}
/**
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 35d84d5d75e..26529e4afcb 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -4042,7 +4042,7 @@ static int region_flip_exec(bContext *C, wmOperator *UNUSED(op))
}
ED_area_tag_redraw(CTX_wm_area(C));
- WM_event_add_mousemove(C);
+ WM_event_add_mousemove(CTX_wm_window(C));
WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, NULL);
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c
index 7f3131a705e..e61b42bf99f 100644
--- a/source/blender/editors/screen/workspace_edit.c
+++ b/source/blender/editors/screen/workspace_edit.c
@@ -334,7 +334,7 @@ static int workspace_append_activate_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", filepath);
WorkSpace *appended_workspace = (WorkSpace *)WM_file_append_datablock(
- C, filepath, ID_WS, idname);
+ bmain, CTX_data_scene(C), CTX_data_view_layer(C), CTX_wm_view3d(C), filepath, ID_WS, idname);
if (appended_workspace) {
/* Set defaults. */