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
path: root/source
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2009-10-10 21:19:49 +0400
committerMartin Poirier <theeth@yahoo.com>2009-10-10 21:19:49 +0400
commit811a7678276e7f0aefaf4145276a71cdd2915a26 (patch)
tree1a1851000569f59cdcf8204eeea88fd6101874ff /source
parentf716f22d1f984c7323ee71682a197d91cb0d06b0 (diff)
Add operator and operator type flag for GRAB_POINTER, don't coopt the OPTYPE_BLOCKING flag for that.
It will check if either the operator or operator type flags are set on top of the user preference before grabbing the pointer. I've set that flag for 3d view navigation operators, others should be set too (no transform, I'll deal with that one).
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c6
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h2
-rw-r--r--source/blender/windowmanager/WM_types.h1
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c6
4 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 4c96e1fee39..3cd810d5c16 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -621,7 +621,7 @@ void VIEW3D_OT_rotate(wmOperatorType *ot)
ot->poll= ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
}
/* ************************ viewmove ******************************** */
@@ -743,7 +743,7 @@ void VIEW3D_OT_move(wmOperatorType *ot)
ot->poll= ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
}
/* ************************ viewzoom ******************************** */
@@ -976,7 +976,7 @@ void VIEW3D_OT_zoom(wmOperatorType *ot)
ot->poll= ED_operator_view3d_active;
/* flags */
- ot->flag= OPTYPE_BLOCKING;
+ ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX);
}
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 2b986d6d802..0292f01fd6d 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -330,7 +330,7 @@ typedef struct wmOperator {
#define OPERATOR_PASS_THROUGH 8
/* wmOperator flag */
-
+#define OP_GRAB_POINTER 1
/* ************** wmEvent ************************ */
/* for read-only rna access, dont save this */
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index d746df01421..31cb5ee0832 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -44,6 +44,7 @@ struct wmWindowManager;
#define OPTYPE_UNDO 2 /* do undo push after after */
#define OPTYPE_BLOCKING 4 /* let blender grab all input from the WM (X11) */
#define OPTYPE_MACRO 8
+#define OPTYPE_GRAB_POINTER 16 /* */
/* context to call operator in for WM_operator_name_call */
/* rna_ui.c contains EnumPropertyItem's of these, keep in sync */
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index ea73ed38123..f1104feaf5b 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -462,8 +462,10 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P
}
else if(retval & OPERATOR_RUNNING_MODAL) {
/* grab cursor during blocking modal ops (X11) */
- if(ot->flag & OPTYPE_BLOCKING)
- WM_cursor_grab(CTX_wm_window(C), (U.uiflag & USER_CONTINUOUS_MOUSE));
+ if(ot->flag & OPTYPE_BLOCKING) {
+ int warp = (U.uiflag & USER_CONTINUOUS_MOUSE) && ((op->flag & OP_GRAB_POINTER) || (ot->flag & OPTYPE_GRAB_POINTER));
+ WM_cursor_grab(CTX_wm_window(C), warp);
+ }
}
else
WM_operator_free(op);