Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-10-08 01:19:35 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-10-08 01:19:35 +0400
commit0c857a4f1462a909b111ec4533e1c1f5ab54af4f (patch)
tree97390de3a70172b7e6c47210094f78a44a019bdd /source/blender/windowmanager/intern/wm_cursors.c
parenta4e36f24c74dfc825347752aae2e55e0247924ef (diff)
- made ungrab a second function - WM_cursor_ungrab
- ungrab can restore the position of the mouse clamped to the window bounds (much nicer for transform)
Diffstat (limited to 'source/blender/windowmanager/intern/wm_cursors.c')
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index d14cde56083..e33132d18b9 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -163,10 +163,16 @@ void WM_cursor_wait(int val)
}
}
-void WM_cursor_grab(wmWindow *win, int val, int warp)
+void WM_cursor_grab(wmWindow *win, int warp)
{
if(win)
- GHOST_SetCursorGrab(win->ghostwin, val, warp);
+ GHOST_SetCursorGrab(win->ghostwin, 1, warp, -1);
+}
+
+void WM_cursor_ungrab(wmWindow *win, int restore)
+{
+ if(win)
+ GHOST_SetCursorGrab(win->ghostwin, 0, -1, restore);
}
/* afer this you can call restore too */