2.5: X11
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 11 Jul 2009 14:51:13 +0000 (14:51 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 11 Jul 2009 14:51:13 +0000 (14:51 +0000)
* 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:
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/armature/editarmature_sketch.c
source/blender/editors/armature/poselib.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/physics/editparticle.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_select.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/transform/transform_ops.c
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_event_system.c

index d6543b41f473567cf439e2e050af465799ad7a75..7de3acdacefab56a821c34f109be1c8412335062 100644 (file)
@@ -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);
index 10691c558bf6d73eed4ce4a29ab7a8ebf7184644..73a1c934d9734d38c774db62d9ee31f76413ee26 100644 (file)
@@ -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);
index 33351c99828f450975f938f4936fb803a1678cd3..af1ed3e27461447b09b10505046bde45b5593efb 100644 (file)
@@ -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
 }
+
index fcc1e8f96441a57c2382ef87d6ca1f2ca842d3b9..93611a30bd8abaa93c7981c5d10f1471153ad636 100644 (file)
@@ -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);
index 54ab0d9ef61b8bd06639a8f69965e9e2eb662bf6..14872f05f8a16be37b7d5bd69bbfdddaec58d3d9 100644 (file)
@@ -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;
index b656aa8fbf6e0a90dadc70d732f600867334b74f..3f7880b7fef16010034e835fc8275cb091cf0d70 100644 (file)
@@ -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", "");
index 99bbe0514c9d9fd7617d5a1eb161523f93db2668..c3b68eb74cef33ae1e280d7ce9595a76c663fcb3 100644 (file)
@@ -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);
index a163ef5f8e29fe034d8e1340d683df82771e1e7f..720e64d260f6742c68c7582a73eb9d3415880cf0 100644 (file)
@@ -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);
index 74b5d5a4206fcd541a80006dd63ff9753cb245c7..c5aea5ae0778b65387a892d5a0c3e8452c6070d6 100644 (file)
@@ -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;
 }
 
index 457deb8c113dcc03c2aaeead2a46e51fa9e4b12e..7245218c688211e613836a50c5ce1877901360c5 100644 (file)
@@ -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", "");
index 358da483744c976d9bd5fe15c85031a649ca0eb7..578da29f102db5026af3125b5c295fdc58981400 100644 (file)
@@ -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 ********************/
index 89d81f846d22ba216329894b1100508487b38505..0384965e49e0b1483602c4ed5cbc8a26acf5b4f7 100644 (file)
@@ -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;
 }
 
 
index 6746c21ebcfb467e1ce44c445c16e3ad7e3c7570..450b17e69bb93dc36af017d38d395a69cdcdf6b8 100644 (file)
@@ -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", "");
        
index 95970798e5369c13c28726da1bb8524889aeb803..5568900e6215f4c161b75bac140ca70fa9db5f18 100644 (file)
@@ -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.");
index 5e77c932a6ca87240d01a253f3c2d411d0a2156d..3c80b650cf3fa63c989ff5633c3f61132c70e9a0 100644 (file)
@@ -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);
 }
index ee4f1b90451e193f88adf2158a39cca05c3d3603..f2630f40c9cbcd792d2ebb4889106b34c8ed2f60 100644 (file)
@@ -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;
index 432140f1cf7bd1835b018c549af7fc3f02020069..ab55f8a4459a88eb7cd9d09976cfd1a39741febb 100644 (file)
@@ -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 */
index 5bcbf5264602c7a3c6ae393f15f0f49f312930df..491b70deedcd5a29db14f0d57f61ecaa22820ec1 100644 (file)
@@ -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);