diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-06-03 10:52:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-06-03 10:55:56 +0300 |
commit | 3041705c5188493e66ca25b597f2b15a1b32c0ca (patch) | |
tree | 6eb771880cc81fc6fca9dbc836ab7ce21035150d /source/blender/windowmanager | |
parent | 4fbc71a320dc55f986e64823656ec6bcb34f18f3 (diff) |
Fix T65294: Orbit navigate gizmo fails in paint modes
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/gizmo/WM_gizmo_types.h | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/windowmanager/gizmo/WM_gizmo_types.h b/source/blender/windowmanager/gizmo/WM_gizmo_types.h index cd8bcc6696b..7afd2908b8e 100644 --- a/source/blender/windowmanager/gizmo/WM_gizmo_types.h +++ b/source/blender/windowmanager/gizmo/WM_gizmo_types.h @@ -85,6 +85,10 @@ typedef enum eWM_GizmoFlag { /** Use the active tools operator properties when running as an operator. */ WM_GIZMO_OPERATOR_TOOL_INIT = (1 << 9), + + /** Don't pass through events to other handlers + * (allows click/drag not to have it's events stolen by press events in other keymaps). */ + WM_GIZMO_EVENT_HANDLE_ALL = (1 << 10), } eWM_GizmoFlag; /** diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 881359677f1..55a106b50c4 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2766,6 +2766,9 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers } } + /* Don't use from now on. */ + const bool is_event_handle_all = gz && (gz->flag & WM_GIZMO_EVENT_HANDLE_ALL); + if (handle_keymap) { /* Handle highlight gizmo. */ if (gz != NULL) { @@ -2797,6 +2800,12 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers } } + if (is_event_handle_all) { + if (action == WM_HANDLER_CONTINUE) { + action |= WM_HANDLER_BREAK | WM_HANDLER_MODAL; + } + } + /* restore the area */ CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); |