From 8466e574680ffd4fc1d43c27f871ba198f24991b Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 10 Jan 2021 15:33:29 +1100 Subject: [PATCH] [client] remove grab/ungrab stubs --- client/src/main.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/client/src/main.c b/client/src/main.c index a7a2a7fb..a9431a79 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -1124,26 +1124,6 @@ static void handleWindowEnter() g_cursor.redraw = true; } -// only called for X11 -static void keyboardGrab() -{ - if (!params.grabKeyboardOnFocus) - return; - - // grab the keyboard so we can intercept WM keys - wmGrabKeyboard(); -} - -// only called for X11 -static void keyboardUngrab() -{ - if (!params.grabKeyboardOnFocus) - return; - - // ungrab the keyboard - wmUngrabKeyboard(); -} - static void setGrab(bool enable) { setGrabQuiet(enable); @@ -1417,7 +1397,10 @@ int eventFilter(void * userdata, SDL_Event * event) if (xe.xfocus.mode == NotifyNormal || xe.xfocus.mode == NotifyUngrab) - keyboardGrab(); + { + if (params.grabKeyboardOnFocus) + wmGrabKeyboard(); + } break; case FocusOut: @@ -1432,7 +1415,10 @@ int eventFilter(void * userdata, SDL_Event * event) if (g_cursor.grab) setGrab(false); else - keyboardUngrab(); + { + if (params.grabKeyboardOnFocus) + wmUngrabKeyboard(); + } } break; }