mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-14 21:17:54 +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
1 changed files with 21 additions and 0 deletions
|
@ -1211,8 +1211,29 @@ int eventFilter(void * userdata, SDL_Event * event)
|
|||
if (params.useSpiceInput)
|
||||
{
|
||||
g_cursor.grab = !g_cursor.grab;
|
||||
|
||||
if (g_state.wminfo.subsystem != SDL_SYSWM_X11)
|
||||
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(
|
||||
g_cursor.grab ? LG_ALERT_SUCCESS : LG_ALERT_WARNING,
|
||||
|
|
Loading…
Reference in a new issue