diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-11 18:51:13 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-11 18:51:13 +0400 |
commit | 79134a54b96e6ca1c835be374481d18853446353 (patch) | |
tree | 30e9f293f4ec57de9c5ee01716ed47ebe18a531b /source/blender/windowmanager | |
parent | f3fdf9257b8d68603b827f62273c79d3cc476207 (diff) |
2.5: X11
* Cursor grabbing is now done only if the OPTYPE_BLOCKING flag
is set for the operator, since for e.g. render it should not
block.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 432140f1cf7..ab55f8a4459 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -40,8 +40,9 @@ struct wmWindowManager; /* ************** wmOperatorType ************************ */ /* flag */ -#define OPTYPE_REGISTER 1 -#define OPTYPE_UNDO 2 +#define OPTYPE_REGISTER 1 /* register operators in stack after finishing */ +#define OPTYPE_UNDO 2 /* do undo push after after */ +#define OPTYPE_BLOCKING 4 /* let blender grab all input from the WM (X11) */ /* 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 5bcbf526460..491b70deedc 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -379,8 +379,9 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P WM_operator_free(op); } else if(retval & OPERATOR_RUNNING_MODAL) { - /* automatically grab cursor during modal ops (X11) */ - WM_cursor_grab(CTX_wm_window(C), 1); + /* grab cursor during blocking modal ops (X11) */ + if(ot->flag & OPTYPE_BLOCKING) + WM_cursor_grab(CTX_wm_window(C), 1); } else WM_operator_free(op); |