Fix this bug: If you open up a dialog/menu in game, and then leave focus of the Xonot...
authorterencehill <piuntn@gmail.com>
Sun, 21 Jul 2013 11:11:04 +0000 (13:11 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 21 Jul 2013 11:11:04 +0000 (13:11 +0200)
qcsrc/menu/menu.qc

index a76efb8e367840cc3737734a781c104556bbe935..78c196995d194a6060216c0843f1b31ca0ad6f22 100644 (file)
@@ -257,6 +257,19 @@ void m_keydown(float key, float ascii)
                return;
        if(!Menu_Active)
                return;
+
+       if(menuMouseMode)
+       if(key >= K_MOUSE1 && key <= K_MOUSE3)
+       {
+               // detect a click outside of the game window
+               vector p = getmousepos();
+               if(p_x < 0 || p_x > realconwidth || p_y < 0 || p_y > realconheight)
+               {
+                       ++mouseButtonsPressed;
+                       return;
+               }
+       }
+
        if(keyGrabber)
        {
                entity e;