Cleanup: remove window manager argument for paint cursor API

This caused an additional argument when exiting object modes
and many other low level functions which don't need to access context.

This simplifies fixing T77073.
This commit is contained in:
2020-06-04 18:35:43 +10:00
parent 1a23b0be97
commit 465a9f65de
17 changed files with 86 additions and 146 deletions

View File

@@ -324,10 +324,8 @@ PyObject *pyrna_callback_classmethod_add(PyObject *UNUSED(self), PyObject *args)
return NULL;
}
bContext *C = BPy_GetContext();
struct wmWindowManager *wm = CTX_wm_manager(C);
handle = WM_paint_cursor_activate(
wm, params.space_type, params.region_type, NULL, cb_wm_cursor_draw, (void *)args);
params.space_type, params.region_type, NULL, cb_wm_cursor_draw, (void *)args);
}
else if (RNA_struct_is_a(srna, &RNA_Space)) {
const char *error_prefix = "Space.draw_handler_add";
@@ -424,9 +422,7 @@ PyObject *pyrna_callback_classmethod_remove(PyObject *UNUSED(self), PyObject *ar
args, "OO!:WindowManager.draw_cursor_remove", &cls, &PyCapsule_Type, &py_handle)) {
return NULL;
}
bContext *C = BPy_GetContext();
struct wmWindowManager *wm = CTX_wm_manager(C);
WM_paint_cursor_end(wm, handle);
WM_paint_cursor_end(handle);
capsule_clear = true;
}
else if (RNA_struct_is_a(srna, &RNA_Space)) {