diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-08-16 14:25:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-08-16 15:21:44 +0300 |
commit | 82e719ff8764da6c48ba3de4e5c11226953002e8 (patch) | |
tree | f17c0ae36fff96c0921c01752806775ff0b876e5 | |
parent | 8e4f55aba6d5ed2eca7d11fb7e6fc942e4a4d492 (diff) |
Fix T64998: Multi window spin tool crash
There could be a more direct way to initialize a gizmo in a view,
for now this resolves the crash.
-rw-r--r-- | source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c index 74700e59e99..7155348fed5 100644 --- a/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c +++ b/source/blender/editors/mesh/editmesh_extrude_spin_gizmo.c @@ -1008,8 +1008,17 @@ static void gizmo_mesh_spin_redo_setup(const bContext *C, wmGizmoGroup *gzgroup) }); } - /* Become modal as soon as it's started. */ - gizmo_mesh_spin_redo_modal_from_setup(C, gzgroup); + wmWindow *win = CTX_wm_window(C); + if (win && win->active) { + bScreen *screen = WM_window_get_active_screen(win); + if (screen->active_region) { + ARegion *ar = CTX_wm_region(C); + if (screen->active_region == ar) { + /* Become modal as soon as it's started. */ + gizmo_mesh_spin_redo_modal_from_setup(C, gzgroup); + } + } + } } static void gizmo_mesh_spin_redo_draw_prepare(const bContext *UNUSED(C), wmGizmoGroup *gzgroup) |