Force cursor grab OFF when running with -d.
authorMartin Poirier <theeth@yahoo.com>
Thu, 15 Oct 2009 20:38:35 +0000 (20:38 +0000)
committerMartin Poirier <theeth@yahoo.com>
Thu, 15 Oct 2009 20:38:35 +0000 (20:38 +0000)
It helps running a debugger when you can click on stuff when on a breakpoint...

source/blender/windowmanager/intern/wm_cursors.c

index e33132d18b980495c4198e577bdd62dbb6129697..c1dfd9ee9fb00af21aafd6312ed79c277c8943d1 100644 (file)
@@ -165,14 +165,19 @@ void WM_cursor_wait(int val)
 
 void WM_cursor_grab(wmWindow *win, int warp)
 {
-       if(win)
-               GHOST_SetCursorGrab(win->ghostwin, 1, warp, -1);
+       /* Only grab cursor when not running debug.
+        * It helps not to get a stuck WM when hitting a breakpoint  
+        * */
+       if ((G.f & G_DEBUG) == 0)
+               if(win)
+                       GHOST_SetCursorGrab(win->ghostwin, 1, warp, -1);
 }
 
 void WM_cursor_ungrab(wmWindow *win, int restore)
 {
-       if(win)
-               GHOST_SetCursorGrab(win->ghostwin, 0, -1, restore);
+       if ((G.f & G_DEBUG) == 0)
+               if(win)
+                       GHOST_SetCursorGrab(win->ghostwin, 0, -1, restore);
 }
 
 /* afer this you can call restore too */