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:
authorTon Roosendaal <ton@blender.org>2013-01-17 14:16:40 +0400
committerTon Roosendaal <ton@blender.org>2013-01-17 14:16:40 +0400
commit7af0fff9d8830bc0add90632d6b9ab4d2d9661c3 (patch)
treed1f876b0901cae8a9d134c04e14680b40af0a323 /source/blender/windowmanager/intern/wm_cursors.c
parent9b57b2315cfc933e699775f2a005b0b03069e156 (diff)
Bug fix #33892
HiDPI "retina" mode didn't work for "Continuous Grab" yet. Note; this mode works by having different coordinate systems for pixels and window/mouse coords. I really hope future HiDPI implementations use the same trick.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_cursors.c')
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index ebde6407a48..180b6b9c742 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -188,12 +188,20 @@ void WM_cursor_grab_enable(wmWindow *win, int wrap, int hide, int bounds[4])
* It helps not to get a stuck WM when hitting a breakpoint
* */
GHOST_TGrabCursorMode mode = GHOST_kGrabNormal;
+ float fac = GHOST_GetNativePixelSize(win->ghostwin);
+ /* in case pixel coords differ from window/mouse coords */
+ bounds[0] /= fac;
+ bounds[1] /= fac;
+ bounds[2] /= fac;
+ bounds[3] /= fac;
+
if (hide) mode = GHOST_kGrabHide;
else if (wrap) mode = GHOST_kGrabWrap;
if ((G.debug & G_DEBUG) == 0) {
if (win && win->ghostwin) {
const GHOST_TabletData *tabletdata = GHOST_GetTabletData(win->ghostwin);
+
/* Note: There is no tabletdata on Windows if no tablet device is connected. */
if (!tabletdata)
GHOST_SetCursorGrab(win->ghostwin, mode, bounds, NULL);