mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-05-31 01:00:53 +00:00
fix releasing of the mouse on setting _windowed_mouse 0
This commit is contained in:
parent
56ac383268
commit
5e44c303e3
1 changed files with 11 additions and 6 deletions
|
@ -301,16 +301,17 @@ event_motion (XEvent *event)
|
||||||
void
|
void
|
||||||
IN_Commands (void)
|
IN_Commands (void)
|
||||||
{
|
{
|
||||||
static int old_windowed, windowed;
|
static int old_windowed_mouse;
|
||||||
|
static int old_in_dga;
|
||||||
|
|
||||||
JOY_Command ();
|
JOY_Command ();
|
||||||
|
|
||||||
windowed = _windowed_mouse->int_val || vid_fullscreen->int_val || in_dga->int_val;
|
if ((old_windowed_mouse != _windowed_mouse->int_val)
|
||||||
|
|| (old_in_dga != in_dga->int_val)) {
|
||||||
|
old_windowed_mouse = _windowed_mouse->int_val;
|
||||||
|
old_in_dga = in_dga->int_val;
|
||||||
|
|
||||||
if (old_windowed != windowed) {
|
if (_windowed_mouse->int_val) { // grab the pointer
|
||||||
old_windowed = windowed;
|
|
||||||
|
|
||||||
if (windowed) { // grab the pointer
|
|
||||||
XGrabPointer (x_disp, x_win, True, MOUSE_MASK, GrabModeAsync,
|
XGrabPointer (x_disp, x_win, True, MOUSE_MASK, GrabModeAsync,
|
||||||
GrabModeAsync, x_win, None, CurrentTime);
|
GrabModeAsync, x_win, None, CurrentTime);
|
||||||
#ifdef HAVE_DGA
|
#ifdef HAVE_DGA
|
||||||
|
@ -431,6 +432,10 @@ IN_Init (void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dga_avail = VID_CheckDGA (x_disp, NULL, NULL, NULL);
|
dga_avail = VID_CheckDGA (x_disp, NULL, NULL, NULL);
|
||||||
|
if (vid_fullscreen->int_val) {
|
||||||
|
Cvar_Set (_windowed_mouse, "1");
|
||||||
|
_windowed_mouse->flags |= CVAR_ROM;
|
||||||
|
}
|
||||||
|
|
||||||
mouse_x = mouse_y = 0.0;
|
mouse_x = mouse_y = 0.0;
|
||||||
mouse_avail = 1;
|
mouse_avail = 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue