From 69c6a33ba1a064aa13da3ef6a74b310620cfafd5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 17 Oct 2009 19:32:28 +0000 Subject: wrap the mouse within the region while grabbing so on release the current view never changes and less likelyhood of loosing the cursor when running blender on 2+ screens. (assuming the 3d view isnt stretched over both) --- source/blender/windowmanager/intern/wm_cursors.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/windowmanager/intern/wm_cursors.c') diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index 1d5b10f2583..5fe62157979 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -163,26 +163,27 @@ void WM_cursor_wait(int val) } } -void WM_cursor_grab(wmWindow *win, int wrap, int hide) +void WM_cursor_grab(wmWindow *win, int wrap, int hide, int *bounds) { /* Only grab cursor when not running debug. * It helps not to get a stuck WM when hitting a breakpoint * */ GHOST_TGrabCursorMode mode = GHOST_kGrabNormal; + int bounds_arr[4] = {-1, -1, -1, -1}; /* l/t/r/b */ if(hide) mode = GHOST_kGrabHide; else if(wrap) mode = GHOST_kGrabWrap; if ((G.f & G_DEBUG) == 0) if(win) - GHOST_SetCursorGrab(win->ghostwin, mode); + GHOST_SetCursorGrab(win->ghostwin, mode, bounds); } void WM_cursor_ungrab(wmWindow *win) { if ((G.f & G_DEBUG) == 0) if(win) - GHOST_SetCursorGrab(win->ghostwin, GHOST_kGrabDisable); + GHOST_SetCursorGrab(win->ghostwin, GHOST_kGrabDisable, NULL); } /* afer this you can call restore too */ -- cgit v1.2.3