wrap the mouse within the region while grabbing so on release the current view never...
[blender-staging.git] / intern / ghost / intern / GHOST_SystemX11.cpp
index 122e6c55241de5a03c51846ee4e6c9654aa3bd68..774fd025b854ef25f35db3ac25fb1c65d90a8110 100644 (file)
@@ -395,7 +395,9 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                                GHOST_TInt32 x_accum, y_accum;
                                GHOST_Rect bounds;
 
-                               window->getClientBounds(bounds);
+                               /* fallback to window bounds */
+                               if(window->getCursorGrabBounds(bounds)==GHOST_kFailure)
+                                       window->getClientBounds(bounds);
 
                                /* could also clamp to screen bounds
                                 * wrap with a window outside the view will fail atm  */