[console] Release the mouse when showing the mouse

This makes mouse grabbing much less painful.
This commit is contained in:
Bill Currie 2023-08-06 12:57:22 +09:00
parent be5ab7b864
commit 35e2ffb4ab
2 changed files with 8 additions and 4 deletions

View file

@ -201,6 +201,7 @@ debug_app_window (const IE_event_t *ie_event)
}
return 1;
}
static int
capture_mouse_event (const IE_event_t *ie_event)
{
@ -217,7 +218,7 @@ capture_mouse_event (const IE_event_t *ie_event)
};
} else if (ie_event->mouse.type == ie_mouseup
&& ((ie_event->mouse.buttons ^ prev_mouse.buttons) & 4)) {
IN_UpdateGrab (in_grab);
IN_UpdateGrab (0);
dragging = false;
}

View file

@ -46,6 +46,7 @@
#include "QF/console.h"
#include "QF/cvar.h"
#include "QF/dstring.h"
#include "QF/input.h"
#include "QF/keys.h"
#include "QF/qargs.h"
#include "QF/quakefs.h"
@ -338,9 +339,11 @@ ClearNotify (void)
static void
con_update_mouse (void)
{
VID_SetCursor (con_force_mouse_visible
|| con_show_mouse
|| !con_hide_mouse);
bool show_cursor = (con_force_mouse_visible
|| con_show_mouse
|| !con_hide_mouse);
VID_SetCursor (show_cursor);
IN_UpdateGrab (show_cursor ? 0 : in_grab);
}
void