foxygit / doom Log in
commit 030b38de23f85b129e357ed97e2a58e21391fe92
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Fri Dec 14 22:23:13 2007 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Fri Dec 14 22:23:13 2007 +0000

    Don't grab the mouse if the mouse is disabled by -nomouse or through
    use_mouse in the configuration file (thanks MikeRS).

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 990
---
 NEWS          | 2 ++
 src/i_video.c | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/NEWS b/NEWS
index e4e2baf7..869e0f69 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@
     Bugs fixed:
      * Desync with STRAIN demos and dehacked Misc values not being
        set properly (thanks Lemonzest)
+     * Don't grab the mouse if the mouse is disabled via -nomouse
+       or use_mouse in the configuration file (thanks MikeRS).

 1.0.0 (2007-12-10):

diff --git a/src/i_video.c b/src/i_video.c
index fe5aca8d..93548498 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -171,6 +171,11 @@ static boolean MouseShouldBeGrabbed()
     if (fullscreen != FULLSCREEN_OFF)
         return true;

+    // Don't grab the mouse if mouse input is disabled
+
+    if (!usemouse || nomouse)
+        return false;
+
     // Drone players don't need mouse focus

     if (drone)