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:
authorJoshua Leung <aligorith@gmail.com>2009-11-19 00:01:04 +0300
committerJoshua Leung <aligorith@gmail.com>2009-11-19 00:01:04 +0300
commit0c8b41e464997a1438ef068e01e9119c1b941a7c (patch)
tree9d46c7469053736a5c58941a3c2139521993470b /source/blender/windowmanager/intern/wm_cursors.c
parentae5a814f26e78dd65557773b5c00c341cdca1947 (diff)
Fix crash on Windows when clicking anywhere in a window. Cursor grabbing code was missing checks for invalid tablet data.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_cursors.c')
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index 9a8c3db0987..6145871f9d4 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -173,16 +173,22 @@ void WM_cursor_grab(wmWindow *win, int wrap, int hide, int *bounds)
if(hide) mode = GHOST_kGrabHide;
else if(wrap) mode = GHOST_kGrabWrap;
- if ((G.f & G_DEBUG) == 0)
- if(win && (GHOST_GetTabletData(win->ghostwin)->Active == GHOST_kTabletModeNone))
- GHOST_SetCursorGrab(win->ghostwin, mode, bounds);
+ if ((G.f & G_DEBUG) == 0) {
+ if (win && win->ghostwin) {
+ const GHOST_TabletData *tabletdata= GHOST_GetTabletData(win->ghostwin);
+
+ if ((tabletdata) && (tabletdata->Active == GHOST_kTabletModeNone))
+ GHOST_SetCursorGrab(win->ghostwin, mode, bounds);
+ }
+ }
}
void WM_cursor_ungrab(wmWindow *win)
{
- if ((G.f & G_DEBUG) == 0)
+ if ((G.f & G_DEBUG) == 0) {
if(win && win->ghostwin)
GHOST_SetCursorGrab(win->ghostwin, GHOST_kGrabDisable, NULL);
+ }
}
/* afer this you can call restore too */