Commit: 2f20b5242cc40abbfa2b3a6580b068c5504805aa
Author: Campbell Barton
Date:   Wed Aug 9 23:37:11 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB2f20b5242cc40abbfa2b3a6580b068c5504805aa

Manipulator: disable cursor grabbing for 2D groups

We could make this a manipulator type flag,
for now disable for all 2D manipulators since its annoying for cage2d.

===================================================================

M       source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c

===================================================================

diff --git 
a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c 
b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
index 085b7b1c787..366996a2e03 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
@@ -835,6 +835,9 @@ void wm_manipulatormap_modal_set(
         wmManipulatorMap *mmap, bContext *C, const wmEvent *event, 
wmManipulator *mpr)
 {
        if (mpr && C) {
+               /* For now only grab cursor for 3D manipulators. */
+               bool grab_cursor = (mpr->parent_mgroup->type->flag & 
WM_MANIPULATORGROUPTYPE_3D) != 0;
+
                mpr->state |= WM_MANIPULATOR_STATE_MODAL;
                mmap->mmap_context.modal = mpr;
 
@@ -862,7 +865,10 @@ void wm_manipulatormap_modal_set(
                                mpr->type->invoke(C, mpr, event);
                        }
                }
-               WM_cursor_grab_enable(CTX_wm_window(C), true, true, NULL);
+
+               if (grab_cursor) {
+                       WM_cursor_grab_enable(CTX_wm_window(C), true, true, 
NULL);
+               }
        }
        else {
                mpr = mmap->mmap_context.modal;

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to