From c29cb494382c6940968d92797c7192d6637f384a Mon Sep 17 00:00:00 2001 From: Ningyuan Li Date: Wed, 1 May 2024 00:46:40 +0900 Subject: [PATCH] keyboard grab for non-webOS platforms --- src/app/ui/streaming/streaming.controller.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/ui/streaming/streaming.controller.c b/src/app/ui/streaming/streaming.controller.c index 62a502b4..3cb0f5e7 100644 --- a/src/app/ui/streaming/streaming.controller.c +++ b/src/app/ui/streaming/streaming.controller.c @@ -221,6 +221,13 @@ static void on_view_created(lv_fragment_t *self, lv_obj_t *view) { controller->notice = notice; controller->notice_label = notice_label; + +#if !defined(TARGET_WEBOS) + const app_settings_t *settings = &controller->global->settings; + if (settings->syskey_capture) { + SDL_SetWindowKeyboardGrab(controller->global->ui.window, SDL_TRUE); + } +#endif } static void on_delete_obj(lv_fragment_t *self, lv_obj_t *view) { @@ -234,6 +241,10 @@ static void on_delete_obj(lv_fragment_t *self, lv_obj_t *view) { } app_input_set_group(&controller->global->ui.input, NULL); lv_group_del(controller->group); + +#if !defined(TARGET_WEBOS) + SDL_SetWindowKeyboardGrab(controller->global->ui.window, SDL_FALSE); +#endif } static void on_obj_deleted(lv_fragment_t *self, lv_obj_t *view) {