mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 22:13:40 +00:00
[client] spice: use XGrabPointer when in grab mode
People using high DPI mice and mouse accleration require this otherwise the mouse can escape the window before we can warp it back.
This commit is contained in:
parent
2bc767430c
commit
bfc492421c
@ -1211,8 +1211,29 @@ int eventFilter(void * userdata, SDL_Event * event)
|
|||||||
if (params.useSpiceInput)
|
if (params.useSpiceInput)
|
||||||
{
|
{
|
||||||
g_cursor.grab = !g_cursor.grab;
|
g_cursor.grab = !g_cursor.grab;
|
||||||
|
|
||||||
if (g_state.wminfo.subsystem != SDL_SYSWM_X11)
|
if (g_state.wminfo.subsystem != SDL_SYSWM_X11)
|
||||||
SDL_SetWindowGrab(g_state.window, g_cursor.grab);
|
SDL_SetWindowGrab(g_state.window, g_cursor.grab);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (g_cursor.grab)
|
||||||
|
{
|
||||||
|
XGrabPointer(g_state.wminfo.info.x11.display,
|
||||||
|
g_state.wminfo.info.x11.window,
|
||||||
|
true,
|
||||||
|
None,
|
||||||
|
GrabModeAsync,
|
||||||
|
GrabModeAsync,
|
||||||
|
g_state.wminfo.info.x11.window,
|
||||||
|
None,
|
||||||
|
CurrentTime);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XUngrabPointer(g_state.wminfo.info.x11.display,
|
||||||
|
CurrentTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
app_alert(
|
app_alert(
|
||||||
g_cursor.grab ? LG_ALERT_SUCCESS : LG_ALERT_WARNING,
|
g_cursor.grab ? LG_ALERT_SUCCESS : LG_ALERT_WARNING,
|
||||||
|
Loading…
Reference in New Issue
Block a user