shithub: choc

Download patch

ref: 9e112d6d1d5329bd4b928934244c7f2330b2dfb1
parent: b96bbaa06d91cce1e62e20cae78095a7fc14a48b
author: Simon Howard <fraggle@gmail.com>
date: Sun Mar 16 16:39:46 EDT 2014

video: Center mouse when grabbing cursor.

When releasing mouse grab (activating menu etc.) we move the mouse
cursor to a non-distracting location at the bottom-right of the
screen. But this was causing abrupt jerks in mouse movement when
re-grabbing the mouse again. Center the mouse when turning on grab so
that this doesn't happen.

This fixes #283.

--- a/src/i_video.c
+++ b/src/i_video.c
@@ -925,6 +925,7 @@
     else if (grab && !currently_grabbed)
     {
         SetShowCursor(false);
+        CenterMouse();
     }
     else if (!grab && currently_grabbed)
     {