diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-10-17 23:32:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-10-17 23:32:28 +0400 |
commit | 69c6a33ba1a064aa13da3ef6a74b310620cfafd5 (patch) | |
tree | 69eb569feb0f03d912391651b7fde6c66c43be98 /source/blender/windowmanager/intern/wm_cursors.c | |
parent | 484bf962c66a5ffb7592cf8e4b462dbfb8d21214 (diff) |
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)
Diffstat (limited to 'source/blender/windowmanager/intern/wm_cursors.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_cursors.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 */ |