[client] wm/wayload: implement keyboard grabbing

This commit is contained in:
Quantum authored and Geoffrey McRae committed 2021-01-12 15:26:42 +11:00
1 parent b58176fcdb
commit 24a4de6d65
3 files changed
+49

No files matched your search

+14
View File
@@ -1240,12 +1240,26 @@ int eventFilter(void * userdata, SDL_Event * event)
case SDL_WINDOWEVENT_FOCUS_GAINED:
if (g_state.wminfo.subsystem != SDL_SYSWM_X11)
{
g_state.focused = true;
if (!inputEnabled())
break;
if (params.grabKeyboardOnFocus)
wmGrabKeyboard();
}
break;
case SDL_WINDOWEVENT_FOCUS_LOST:
if (g_state.wminfo.subsystem != SDL_SYSWM_X11)
{
g_state.focused = false;
if (!inputEnabled())
break;
if (params.grabKeyboardOnFocus)
wmUngrabKeyboard();
}
break;
case SDL_WINDOWEVENT_SIZE_CHANGED: