[client] spice: also grab keyboard when in capture mode

This commit is contained in:
Geoffrey McRae 2021-01-04 13:22:54 +11:00
parent bfc492421c
commit 43e3999a95

View File

@ -1218,7 +1218,8 @@ int eventFilter(void * userdata, SDL_Event * event)
{ {
if (g_cursor.grab) if (g_cursor.grab)
{ {
XGrabPointer(g_state.wminfo.info.x11.display, XGrabPointer(
g_state.wminfo.info.x11.display,
g_state.wminfo.info.x11.window, g_state.wminfo.info.x11.window,
true, true,
None, None,
@ -1227,11 +1228,19 @@ int eventFilter(void * userdata, SDL_Event * event)
g_state.wminfo.info.x11.window, g_state.wminfo.info.x11.window,
None, None,
CurrentTime); CurrentTime);
XGrabKeyboard(
g_state.wminfo.info.x11.display,
g_state.wminfo.info.x11.window,
true,
GrabModeAsync,
GrabModeAsync,
CurrentTime);
} }
else else
{ {
XUngrabPointer(g_state.wminfo.info.x11.display, XUngrabKeyboard(g_state.wminfo.info.x11.display, CurrentTime);
CurrentTime); XUngrabPointer(g_state.wminfo.info.x11.display, CurrentTime);
} }
} }