From 5aad58610aaac884021dc35aa1c30498db32381d Mon Sep 17 00:00:00 2001 From: Mark Olsen Date: Sun, 12 Jul 2009 18:57:40 +0000 Subject: [PATCH] Always grab the mouse in fullscreen mode. Use Key_MouseShouldBeFree() instead of peeking the mouseusedforgui global. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3266 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_vidlinuxglx.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/engine/gl/gl_vidlinuxglx.c b/engine/gl/gl_vidlinuxglx.c index 94ab4cdf9..a2642d3c1 100644 --- a/engine/gl/gl_vidlinuxglx.c +++ b/engine/gl/gl_vidlinuxglx.c @@ -61,6 +61,7 @@ static Window vid_window; static GLXContext ctx = NULL; int scrnum; +static qboolean vidglx_fullscreen; static float old_windowed_mouse = 0; @@ -556,7 +557,7 @@ static void GetEvent(void) wantwindowed = !!_windowed_mouse.value; if (!ActiveApp) wantwindowed = false; - if (key_dest == key_console) + if (key_dest == key_console && !vidglx_fullscreen) wantwindowed = false; if (old_windowed_mouse != wantwindowed) @@ -881,6 +882,8 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette) } #endif + vidglx_fullscreen = fullscreen; + /* window attributes */ attr.background_pixel = 0; attr.border_pixel = 0; @@ -1040,18 +1043,14 @@ IN_Move */ void IN_MouseMove (float *movements, int pnum) { - extern int mouseusedforgui, mousecursor_x, mousecursor_y; + extern int mousecursor_x, mousecursor_y; extern int mousemove_x, mousemove_y; float mx, my; mx = mouse_x; my = mouse_y; - if (mouseusedforgui || (key_dest == key_menu && (m_state == m_complex || m_state == m_plugin)) -#ifdef VM_UI - || UI_MenuState() -#endif - ) + if (Key_MouseShouldBeFree()) { mousemove_x += mouse_x; mousemove_y += mouse_y;