diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-11-26 05:58:53 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-11-26 05:58:53 +0300 |
commit | eee8bf344acaae83af294774f1d90b0d07f53fc7 (patch) | |
tree | a30f121784bf275e869f414c84c2b2dd3c990260 /intern/ghost | |
parent | cbc2c1886dee40134a9c08710978ba75df4cf37b (diff) |
Cursor Grab bugfix: passing NULL for bounds didn't initialize properly.
Symptom: first button drag gets stuck on values.
Cause: Buttons didn't set grab bounds, to use the whole window. But Ghost didn't do anything in that case, it left the bounds value as is. It only affected the first cursor grab, because cursor ungrab sets it to -1, which forces it to use the whole window size (checking every mouse move) for subsequent grabs.
Solution: When NULL, init bounds to window size (and don't query every mouse move).
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_Window.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_Window.cpp b/intern/ghost/intern/GHOST_Window.cpp index e89e0274276..14a255e2e5e 100644 --- a/intern/ghost/intern/GHOST_Window.cpp +++ b/intern/ghost/intern/GHOST_Window.cpp @@ -109,6 +109,8 @@ GHOST_TSuccess GHOST_Window::setCursorGrab(GHOST_TGrabCursorMode mode, GHOST_Rec m_cursorGrabBounds.m_l= m_cursorGrabBounds.m_r= -1; else if (bounds) { m_cursorGrabBounds= *bounds; + } else { /* if bounds not defined, use window */ + getClientBounds(m_cursorGrabBounds); } m_cursorGrab = mode; return GHOST_kSuccess; |