[client] don't grab keyboard if spice input is disabled

This commit is contained in:
Geoffrey McRae 2020-12-01 10:03:20 +11:00
parent 806ff934b2
commit 301ba45f0f

View File

@ -1030,12 +1030,18 @@ int eventFilter(void * userdata, SDL_Event * event)
break; break;
case FocusIn: case FocusIn:
if (!params.useSpiceInput)
break;
if (xe.xfocus.mode == NotifyNormal || if (xe.xfocus.mode == NotifyNormal ||
xe.xfocus.mode == NotifyUngrab) xe.xfocus.mode == NotifyUngrab)
keyboardGrab(); keyboardGrab();
break; break;
case FocusOut: case FocusOut:
if (!params.useSpiceInput)
break;
if (xe.xfocus.mode == NotifyNormal || if (xe.xfocus.mode == NotifyNormal ||
xe.xfocus.mode == NotifyWhileGrabbed) xe.xfocus.mode == NotifyWhileGrabbed)
keyboardUngrab(); keyboardUngrab();
@ -1854,7 +1860,7 @@ int main(int argc, char * argv[])
if (!config_load(argc, argv)) if (!config_load(argc, argv))
return -1; return -1;
if (params.grabKeyboard) if (params.useSpiceInput && params.grabKeyboard)
SDL_SetHint(SDL_HINT_GRAB_KEYBOARD, "1"); SDL_SetHint(SDL_HINT_GRAB_KEYBOARD, "1");
const int ret = lg_run(); const int ret = lg_run();