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 | |
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.
18 files changed, 74 insertions, 42 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index d6543b41f47..7de3acdacef 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -620,7 +620,7 @@ static void MARKER_OT_move(wmOperatorType *ot) ot->poll= ED_operator_areaactive; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* rna storage */ RNA_def_int(ot->srna, "frames", 0, INT_MIN, INT_MAX, "Frames", "", INT_MIN, INT_MAX); diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 10691c558bf..73a1c934d97 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -209,6 +209,9 @@ void ANIM_OT_change_frame(wmOperatorType *ot) ot->invoke= change_frame_invoke; ot->cancel= change_frame_cancel; ot->modal= change_frame_modal; + + /* flags */ + ot->flag= OPTYPE_BLOCKING; /* rna */ RNA_def_int(ot->srna, "frame", 0, MINAFRAME, MAXFRAME, "Frame", "", MINAFRAME, MAXFRAME); diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 33351c99828..af1ed3e2746 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -3463,7 +3463,7 @@ void SKETCH_OT_draw_stroke(wmOperatorType *ot) RNA_def_boolean(ot->srna, "snap", 0, "Snap", ""); /* flags */ -// ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_BLOCKING; // OPTYPE_REGISTER|OPTYPE_UNDO } void SKETCH_OT_gesture(wmOperatorType *ot) @@ -3482,5 +3482,6 @@ void SKETCH_OT_gesture(wmOperatorType *ot) RNA_def_boolean(ot->srna, "snap", 0, "Snap", ""); /* flags */ -// ot->flag= OPTYPE_UNDO; + ot->flag= OPTYPE_BLOCKING; // OPTYPE_UNDO } + diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index fcc1e8f9644..93611a30bd8 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -1489,7 +1489,7 @@ void POSELIB_OT_browse_interactive (wmOperatorType *ot) ot->poll= ED_operator_posemode; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* properties */ RNA_def_int(ot->srna, "pose_index", -1, -2, INT_MAX, "Pose", "Index of the pose to apply (-2 for no change to pose, -1 for poselib active pose)", 0, INT_MAX); diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 54ab0d9ef61..14872f05f8a 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -257,7 +257,7 @@ void VIEW2D_OT_pan(wmOperatorType *ot) ot->modal= view_pan_modal; /* operator is repeatable */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; /* rna - must keep these in sync with the other operators */ RNA_def_int(ot->srna, "deltax", 0, INT_MIN, INT_MAX, "Delta X", "", INT_MIN, INT_MAX); @@ -832,7 +832,7 @@ void VIEW2D_OT_zoom(wmOperatorType *ot) ot->modal= view_zoomdrag_modal; /* operator is repeatable */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; /* rna - must keep these in sync with the other operators */ RNA_def_float(ot->srna, "deltax", 0, -FLT_MAX, FLT_MAX, "Delta X", "", -FLT_MAX, FLT_MAX); @@ -1261,6 +1261,9 @@ void VIEW2D_OT_scroller_activate(wmOperatorType *ot) /* identifiers */ ot->name= "Scroller Activate"; ot->idname= "VIEW2D_OT_scroller_activate"; + + /* flags */ + ot->flag= OPTYPE_BLOCKING; /* api callbacks */ ot->invoke= scroller_activate_invoke; diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c index b656aa8fbf6..3f7880b7fef 100644 --- a/source/blender/editors/physics/editparticle.c +++ b/source/blender/editors/physics/editparticle.c @@ -2344,7 +2344,7 @@ void PARTICLE_OT_brush_radial_control(wmOperatorType *ot) ot->poll= PE_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } /*************************** delete operator **************************/ @@ -3358,7 +3358,7 @@ void PARTICLE_OT_brush_edit(wmOperatorType *ot) ot->poll= PE_poll_3dview; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* properties */ RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 99bbe0514c9..c3b68eb74ce 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -503,8 +503,10 @@ void SCREEN_OT_actionzone(wmOperatorType *ot) ot->invoke= actionzone_invoke; ot->modal= actionzone_modal; - ot->poll= actionzone_area_poll; + + ot->flag= OPTYPE_BLOCKING; + RNA_def_int(ot->srna, "modifier", 0, 0, 2, "modifier", "modifier state", 0, 2); } @@ -618,6 +620,8 @@ static void SCREEN_OT_area_swap(wmOperatorType *ot) ot->invoke= area_swap_invoke; ot->modal= area_swap_modal; ot->poll= ED_operator_areaactive; + + ot->flag= OPTYPE_BLOCKING; } /* *********** Duplicate area as new window operator ****************** */ @@ -912,9 +916,10 @@ void SCREEN_OT_area_move(wmOperatorType *ot) ot->invoke= area_move_invoke; ot->cancel= area_move_cancel; ot->modal= area_move_modal; - ot->poll= ED_operator_screen_mainwinactive; /* when mouse is over area-edge */ + ot->flag= OPTYPE_BLOCKING; + /* rna */ RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "y", 0, INT_MIN, INT_MAX, "Y", "", INT_MIN, INT_MAX); @@ -1227,7 +1232,7 @@ void SCREEN_OT_area_split(wmOperatorType *ot) ot->modal= area_split_modal; ot->poll= ED_operator_areaactive; - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; /* rna */ RNA_def_enum(ot->srna, "direction", prop_direction_items, 'h', "Direction", ""); @@ -1344,6 +1349,8 @@ static void SCREEN_OT_region_scale(wmOperatorType *ot) ot->modal= region_scale_modal; ot->poll= ED_operator_areaactive; + + ot->flag= OPTYPE_BLOCKING; } @@ -1725,9 +1732,10 @@ void SCREEN_OT_area_join(wmOperatorType *ot) ot->exec= area_join_exec; ot->invoke= area_join_invoke; ot->modal= area_join_modal; - ot->poll= ED_operator_areaactive; + ot->flag= OPTYPE_BLOCKING; + /* rna */ RNA_def_int(ot->srna, "x1", -100, INT_MIN, INT_MAX, "X 1", "", INT_MIN, INT_MAX); RNA_def_int(ot->srna, "y1", -100, INT_MIN, INT_MAX, "Y 1", "", INT_MIN, INT_MAX); diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index a163ef5f8e2..720e64d260f 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -4804,7 +4804,7 @@ void PAINT_OT_image_paint(wmOperatorType *ot) ot->poll= image_paint_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* properties */ RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); @@ -4911,7 +4911,7 @@ void PAINT_OT_image_paint_radial_control(wmOperatorType *ot) ot->poll= image_paint_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } /************************ grab clone operator ************************/ @@ -5010,7 +5010,7 @@ void PAINT_OT_grab_clone(wmOperatorType *ot) ot->poll= image_paint_2d_clone_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* properties */ RNA_def_float_vector(ot->srna, "delta", 2, NULL, -FLT_MAX, FLT_MAX, "Delta", "Delta offset of clone image in 0.0..1.0 coordinates.", -1.0f, 1.0f); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 74b5d5a4206..c5aea5ae077 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1225,7 +1225,7 @@ void PAINT_OT_weight_paint_radial_control(wmOperatorType *ot) ot->poll= wp_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } void PAINT_OT_vertex_paint_radial_control(wmOperatorType *ot) @@ -1241,7 +1241,7 @@ void PAINT_OT_vertex_paint_radial_control(wmOperatorType *ot) ot->poll= vp_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } /* ************ weight paint operator ********** */ @@ -1567,7 +1567,7 @@ void PAINT_OT_weight_paint(wmOperatorType *ot) ot->poll= wp_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } @@ -1864,6 +1864,6 @@ void PAINT_OT_vertex_paint(wmOperatorType *ot) ot->poll= vp_poll; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 457deb8c113..7245218c688 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1151,7 +1151,7 @@ static void SCULPT_OT_radial_control(wmOperatorType *ot) ot->exec= sculpt_radial_control_exec; ot->poll= sculpt_poll; - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } /**** Operator for applying a stroke (various attributes including mouse path) @@ -1589,7 +1589,7 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot) ot->poll= sculpt_poll; /* flags (sculpt does own undo? (ton) */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; /* properties */ RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 358da483744..578da29f102 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -251,6 +251,9 @@ void IMAGE_OT_view_pan(wmOperatorType *ot) ot->modal= view_pan_modal; ot->cancel= view_pan_cancel; ot->poll= space_image_main_area_poll; + + /* flags */ + ot->flag= OPTYPE_BLOCKING; /* properties */ RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX, @@ -363,6 +366,9 @@ void IMAGE_OT_view_zoom(wmOperatorType *ot) ot->modal= view_zoom_modal; ot->cancel= view_zoom_cancel; ot->poll= space_image_main_area_poll; + + /* flags */ + ot->flag= OPTYPE_BLOCKING; /* properties */ RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, FLT_MAX, @@ -1487,6 +1493,9 @@ void IMAGE_OT_sample(wmOperatorType *ot) ot->modal= sample_modal; ot->cancel= sample_cancel; ot->poll= space_image_main_area_poll; + + /* flags */ + ot->flag= OPTYPE_BLOCKING; } /******************** set curve point operator ********************/ diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 89d81f846d2..0384965e49e 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1178,7 +1178,7 @@ void NODE_OT_resize(wmOperatorType *ot) ot->poll= ED_operator_node_active; /* flags */ - ot->flag= 0; + ot->flag= OPTYPE_BLOCKING; } @@ -2012,7 +2012,7 @@ void NODE_OT_link(wmOperatorType *ot) ot->poll= ED_operator_node_active; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; } diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 6746c21ebcf..450b17e69bb 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -213,7 +213,7 @@ void NODE_OT_select(wmOperatorType *ot) ot->modal= node_select_modal; /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; RNA_def_enum(ot->srna, "select_type", prop_select_items, 0, "Select Type", ""); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 95970798e53..5568900e621 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1836,6 +1836,9 @@ void TEXT_OT_scroll(wmOperatorType *ot) ot->cancel= scroll_cancel; ot->poll= text_space_edit_poll; + /* flags */ + ot->flag= OPTYPE_BLOCKING; + /* properties */ RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll.", -100, 100); } @@ -1880,6 +1883,9 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot) ot->cancel= scroll_cancel; ot->poll= text_region_edit_poll; + /* flags */ + ot->flag= OPTYPE_BLOCKING; + /* properties */ RNA_def_int(ot->srna, "lines", 1, INT_MIN, INT_MAX, "Lines", "Number of lines to scroll.", -100, 100); } @@ -2151,7 +2157,7 @@ void TEXT_OT_cursor_set(wmOperatorType *ot) ot->poll= text_region_edit_poll; /* flags */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; /* properties */ RNA_def_boolean(ot->srna, "select", 0, "Select", "Set selection end rather than cursor."); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 5e77c932a6c..3c80b650cf3 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -560,7 +560,7 @@ void VIEW3D_OT_viewrotate(wmOperatorType *ot) ot->poll= ED_operator_view3d_active; /* flags */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; } /* ************************ viewmove ******************************** */ @@ -644,7 +644,7 @@ void VIEW3D_OT_viewmove(wmOperatorType *ot) ot->poll= ED_operator_view3d_active; /* flags */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; } /* ************************ viewzoom ******************************** */ @@ -844,7 +844,7 @@ void VIEW3D_OT_zoom(wmOperatorType *ot) ot->poll= ED_operator_view3d_active; /* flags */ - ot->flag= OPTYPE_REGISTER; + ot->flag= OPTYPE_REGISTER|OPTYPE_BLOCKING; RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX); } diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index ee4f1b90451..f2630f40c9c 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -302,7 +302,7 @@ void TFM_OT_translation(struct wmOperatorType *ot) /* identifiers */ ot->name = "Translation"; ot->idname = OP_TRANSLATION; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -327,7 +327,7 @@ void TFM_OT_resize(struct wmOperatorType *ot) /* identifiers */ ot->name = "Resize"; ot->idname = OP_RESIZE; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -353,7 +353,7 @@ void TFM_OT_trackball(struct wmOperatorType *ot) /* identifiers */ ot->name = "Trackball"; ot->idname = OP_TRACKBALL; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -374,7 +374,7 @@ void TFM_OT_rotation(struct wmOperatorType *ot) /* identifiers */ ot->name = "Rotation"; ot->idname = OP_ROTATION; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -399,7 +399,7 @@ void TFM_OT_tilt(struct wmOperatorType *ot) /* identifiers */ ot->name = "Tilt"; ot->idname = OP_TILT; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -422,7 +422,7 @@ void TFM_OT_warp(struct wmOperatorType *ot) /* identifiers */ ot->name = "Warp"; ot->idname = OP_WARP; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -446,7 +446,7 @@ void TFM_OT_shear(struct wmOperatorType *ot) /* identifiers */ ot->name = "Shear"; ot->idname = OP_SHEAR; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -470,7 +470,7 @@ void TFM_OT_shrink_fatten(struct wmOperatorType *ot) /* identifiers */ ot->name = "Shrink/Fatten"; ot->idname = OP_SHRINK_FATTEN; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -491,7 +491,7 @@ void TFM_OT_tosphere(struct wmOperatorType *ot) /* identifiers */ ot->name = "To Sphere"; ot->idname = OP_TOSPHERE; - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; @@ -542,7 +542,7 @@ void TFM_OT_transform(struct wmOperatorType *ot) /* identifiers */ ot->name = "Transform"; ot->idname = "TFM_OT_transform"; - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; /* api callbacks */ ot->invoke = transform_invoke; 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); |