diff --git a/CMakeLists.txt b/CMakeLists.txt index 227e9e578..1ff9f5bfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -253,7 +253,6 @@ if (TARGET_WEBOS) set(FEATURE_INPUT_EVMOUSE ON) target_compile_definitions(moonlight-lib PUBLIC TARGET_WEBOS OS_LINUX _GNU_SOURCE APPID="${WEBOS_APPINFO_ID}") - target_compile_definitions(moonlight-lib PUBLIC HAVE_RELATIVE_MOUSE_HACK) target_compile_definitions(moonlight-lib PUBLIC GAMECONTROLLERDB_PLATFORM="webOS" GAMECONTROLLERDB_PLATFORM_USE="Linux") target_include_directories(moonlight-lib SYSTEM PUBLIC ${PBNJSON_C_INCLUDE_DIRS} ${PMLOG_INCLUDE_DIRS} diff --git a/src/app/input/app_input.c b/src/app/input/app_input.c index 1e185067a..a6d867598 100644 --- a/src/app/input/app_input.c +++ b/src/app/input/app_input.c @@ -15,7 +15,7 @@ void app_input_init(app_input_t *input, app_t *app) { SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER); input->max_num_gamepads = 4; input->gamepads_count = 0; - for(int i = 0; i < input->max_num_gamepads; i++) { + for (int i = 0; i < input->max_num_gamepads; i++) { input->gamepads[i].instance_id = -1; input->gamepads[i].gs_id = -1; } @@ -41,29 +41,12 @@ void app_input_deinit(app_input_t *input) { } void app_set_mouse_grab(app_input_t *input, bool grab) { -#if HAVE_RELATIVE_MOUSE_HACK - if (grab && input->blank_cursor_surface->userdata != NULL) { - commons_log_debug("Input", "Set cursor to blank bitmap: %p", input->blank_cursor_surface->userdata); - SDL_SetCursor(input->blank_cursor_surface->userdata); - } else { - SDL_SetCursor(SDL_GetDefaultCursor()); - } -#else - if (app_configuration->hardware_mouse) { - SDL_ShowCursor(grab ? SDL_FALSE : SDL_TRUE); - } else { + if (!app_configuration->hardware_mouse) { SDL_SetRelativeMouseMode(grab && !app_configuration->absmouse ? SDL_TRUE : SDL_FALSE); - if (!grab) { - SDL_ShowCursor(SDL_TRUE); - } } -#endif + SDL_ShowCursor(grab ? SDL_FALSE : SDL_TRUE); } bool app_get_mouse_relative() { -#if HAVE_RELATIVE_MOUSE_HACK - return !app_configuration->absmouse; -#else return SDL_GetRelativeMouseMode() == SDL_TRUE; -#endif } diff --git a/src/app/lvgl/input/lv_sdl_drv_pointer_input.c b/src/app/lvgl/input/lv_sdl_drv_pointer_input.c index 96b1d50d8..852ef8ee8 100644 --- a/src/app/lvgl/input/lv_sdl_drv_pointer_input.c +++ b/src/app/lvgl/input/lv_sdl_drv_pointer_input.c @@ -31,23 +31,12 @@ static void indev_pointer_read(lv_indev_drv_t *drv, lv_indev_data_t *data) { indev_point_def(data); return; } - static bool warped = false; if (e.type == SDL_MOUSEMOTION) { - if (!warped && app->session != NULL) { + if (app->session != NULL) { session_handle_input_event(app->session, &e); } data->state = e.motion.state; data->point = (lv_point_t) {.x = e.motion.x, .y = e.motion.y}; -#if HAVE_RELATIVE_MOUSE_HACK - if (warped || e.motion.which == SDL_TOUCH_MOUSEID) { - warped = false; - } else if (app->session != NULL && session_accepting_input(app->session) && app_get_mouse_relative()) { - int w, h; - SDL_GetWindowSize(input->ui->window, &w, &h); - SDL_WarpMouseInWindow(input->ui->window, w / 2, h / 2); - warped = true; - } -#endif } else { if (app->session != NULL) { session_handle_input_event(app->session, &e);