We now XWarpPointer () the mouse OUT of the window when working with DGA

input.  This is a Good Thing for Voodoo3 users.
This commit is contained in:
Joseph Carter 2000-05-07 13:47:00 +00:00
parent 5f3e15ceb3
commit 2d78c66bbf
3 changed files with 17 additions and 8 deletions

View file

@ -434,6 +434,7 @@ IN_Shutdown(void)
x11_close_display(); x11_close_display();
} }
extern int scr_width, scr_height;
int int
IN_Init(void) IN_Init(void)
@ -475,11 +476,14 @@ IN_Init(void)
XF86DGADirectMouse|XF86DGADirectKeyb); XF86DGADirectMouse|XF86DGADirectKeyb);
// XF86DGASetVidPage(x_disp, DefaultScreen(x_disp), 0); // XF86DGASetVidPage(x_disp, DefaultScreen(x_disp), 0);
XGrabKeyboard(x_disp, x_win, True, GrabModeAsync, GrabModeAsync, XGrabKeyboard (x_disp, x_win, True, GrabModeAsync,
CurrentTime); GrabModeAsync, CurrentTime);
XGrabPointer(x_disp, x_win, True, MOUSE_MASK,
GrabModeAsync, GrabModeAsync, XGrabPointer (x_disp, x_win, True, MOUSE_MASK, GrabModeAsync,
x_win, None, CurrentTime); 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, in_dgamouse = Cvar_Get ("in_dgamouse", "1", CVAR_ROM,
"1 if you have DGA mouse support"); "1 if you have DGA mouse support");

View file

@ -112,7 +112,7 @@ static void *dlhand = NULL;
static GLboolean (*QF_XMesaSetFXmode)(GLint mode) = 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) #if defined(XMESA) || defined(HAS_DGA)
int VID_options_items = 2; int VID_options_items = 2;

View file

@ -116,6 +116,8 @@ static unsigned long r_mask,g_mask,b_mask;
static long X11_highhunkmark; static long X11_highhunkmark;
int scr_width, scr_height;
#define STD_EVENT_MASK \ #define STD_EVENT_MASK \
( VisibilityChangeMask | ExposureMask | StructureNotifyMask) ( VisibilityChangeMask | ExposureMask | StructureNotifyMask)
@ -623,6 +625,9 @@ void VID_Init (unsigned char *palette)
x_visinfo->depth, InputOutput, x_vis, x_visinfo->depth, InputOutput, x_vis,
attribmask, &attribs); attribmask, &attribs);
scr_width = vid.width;
scr_height = vid.height;
/* Give it a title */ /* Give it a title */
XStoreName(x_disp, x_win, "XQuake"); XStoreName(x_disp, x_win, "XQuake");