[Bf-blender-cvs] [b147473] master: Fix T44892: Cursor warp, invoked outside the area

Campbell Barton noreply at git.blender.org
Mon Jun 1 04:04:02 CEST 2015


Commit: b147473f023e5ee9c2b8324362a293e65be9d2c8
Author: Campbell Barton
Date:   Mon Jun 1 11:59:02 2015 +1000
Branches: master
https://developer.blender.org/rBb147473f023e5ee9c2b8324362a293e65be9d2c8

Fix T44892: Cursor warp, invoked outside the area

If an operator starts outside an area, don't use warping.
(problematic for menu's).

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

M	source/blender/windowmanager/intern/wm_event_system.c

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

diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 06449f5..3a213cd 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1141,7 +1141,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event,
 				}
 
 				if (wrap) {
-					rcti *winrect = NULL;
+					const rcti *winrect = NULL;
 					ARegion *ar = CTX_wm_region(C);
 					ScrArea *sa = CTX_wm_area(C);
 
@@ -1150,7 +1150,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event,
 					{
 						winrect = &ar->winrct;
 					}
-					else if (sa) {
+					else if (sa && BLI_rcti_isect_pt_v(&sa->totrct, &event->x)) {
 						winrect = &sa->totrct;
 					}




More information about the Bf-blender-cvs mailing list