diff --git a/common/in_x11.c b/common/in_x11.c index 47c20c4..239f391 100644 --- a/common/in_x11.c +++ b/common/in_x11.c @@ -434,6 +434,7 @@ IN_Shutdown(void) x11_close_display(); } +extern int scr_width, scr_height; int IN_Init(void) @@ -475,17 +476,20 @@ IN_Init(void) XF86DGADirectMouse|XF86DGADirectKeyb); // XF86DGASetVidPage(x_disp, DefaultScreen(x_disp), 0); - XGrabKeyboard(x_disp, x_win, True, GrabModeAsync, GrabModeAsync, - CurrentTime); - XGrabPointer(x_disp, x_win, True, MOUSE_MASK, - GrabModeAsync, GrabModeAsync, - x_win, None, CurrentTime); + XGrabKeyboard (x_disp, x_win, True, GrabModeAsync, + GrabModeAsync, CurrentTime); + + XGrabPointer (x_disp, x_win, True, MOUSE_MASK, GrabModeAsync, + GrabModeAsync, x_win, None, CurrentTime); + + XWarpPointer (x_disp, None, x_win, 0, 0, 0, 0, scr_width, + scr_height); in_dgamouse = Cvar_Get ("in_dgamouse", "1", CVAR_ROM, - "1 if you have DGA mouse support"); + "1 if you have DGA mouse support"); } else in_dgamouse = Cvar_Get ("in_dgamouse", "0", CVAR_ROM, - "1 if you have DGA mouse support"); + "1 if you have DGA mouse support"); #endif if (COM_CheckParm("-nomouse")) return 1; diff --git a/common/vid_glx.c b/common/vid_glx.c index ddb6042..be520df 100644 --- a/common/vid_glx.c +++ b/common/vid_glx.c @@ -112,7 +112,7 @@ static void *dlhand = NULL; static GLboolean (*QF_XMesaSetFXmode)(GLint mode) = NULL; -static int scr_width, scr_height; +int scr_width, scr_height; #if defined(XMESA) || defined(HAS_DGA) int VID_options_items = 2; diff --git a/common/vid_x11.c b/common/vid_x11.c index 04f62b1..a3613a8 100644 --- a/common/vid_x11.c +++ b/common/vid_x11.c @@ -116,6 +116,8 @@ static unsigned long r_mask,g_mask,b_mask; static long X11_highhunkmark; +int scr_width, scr_height; + #define STD_EVENT_MASK \ ( VisibilityChangeMask | ExposureMask | StructureNotifyMask) @@ -623,6 +625,9 @@ void VID_Init (unsigned char *palette) x_visinfo->depth, InputOutput, x_vis, attribmask, &attribs); + scr_width = vid.width; + scr_height = vid.height; + /* Give it a title */ XStoreName(x_disp, x_win, "XQuake");