diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-12-07 21:05:51 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-12-07 21:05:51 +0300 |
commit | 149b3bc7f2791e61d94dd91390b66fce7ff45aac (patch) | |
tree | 627cb7110c3d86825aa46ff7ac203aa1bb273dc8 /source | |
parent | 4a23c3f9e1aaaefcb7b5586b908c51d2922d71fb (diff) |
Flag down a window when cursor is grabbed.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/DNA_windowmanager_types.h | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_cursors.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 1af1dd7a158..24374720232 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -139,7 +139,10 @@ typedef struct wmWindow { void *ghostwin; /* dont want to include ghost.h stuff */ - int winid, pad; /* winid also in screens, is for retrieving this window after read */ + int winid; /* winid also in screens, is for retrieving this window after read */ + + short grabcursor; /* 1 if cursor is grabbed */ + short pad; struct bScreen *screen; /* active screen */ struct bScreen *newscreen; /* temporary when switching */ diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index 95a1de96115..cec5886014a 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -180,6 +180,8 @@ void WM_cursor_grab(wmWindow *win, int wrap, int hide, int *bounds) GHOST_SetCursorGrab(win->ghostwin, mode, bounds); else if (tabletdata->Active == GHOST_kTabletModeNone) GHOST_SetCursorGrab(win->ghostwin, mode, bounds); + + win->grabcursor = 1; } } } @@ -187,8 +189,10 @@ void WM_cursor_grab(wmWindow *win, int wrap, int hide, int *bounds) void WM_cursor_ungrab(wmWindow *win) { if ((G.f & G_DEBUG) == 0) { - if(win && win->ghostwin) + if(win && win->ghostwin) { GHOST_SetCursorGrab(win->ghostwin, GHOST_kGrabDisable, NULL); + win->grabcursor = 0; + } } } |