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/makesrna/intern/rna_wm_api.c
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/makesrna/intern/rna_wm_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 98e2f0c993d..db7a7d6852b 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -83,9 +83,14 @@ static wmKeyMap *rna_keymap_active(wmKeyMap *km, bContext *C)
return WM_keymap_active(wm, km);
}
+static void rna_keymap_restore_to_default(wmKeyMap *km, bContext *C)
+{
+ WM_keymap_restore_to_default(km, CTX_wm_manager(C));
+}
+
static void rna_keymap_restore_item_to_default(wmKeyMap *km, bContext *C, wmKeyMapItem *kmi)
{
- WM_keymap_item_restore_to_default(C, km, kmi);
+ WM_keymap_item_restore_to_default(CTX_wm_manager(C), km, kmi);
}
static void rna_Operator_report(wmOperator *op, int type, const char *msg)
@@ -1050,7 +1055,7 @@ void RNA_api_keymap(StructRNA *srna)
parm = RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Active key map");
RNA_def_function_return(func, parm);
- func = RNA_def_function(srna, "restore_to_default", "WM_keymap_restore_to_default");
+ func = RNA_def_function(srna, "restore_to_default", "rna_keymap_restore_to_default");
RNA_def_function_flag(func, FUNC_USE_CONTEXT);
func = RNA_def_function(srna, "restore_item_to_default", "rna_keymap_restore_item_to_default");