From 4e9475dd9f82274520751eb586b75384236d891b Mon Sep 17 00:00:00 2001 From: Ningyuan Li Date: Mon, 25 Mar 2024 14:29:38 +0900 Subject: [PATCH] fixed webOS warp mouse --- src/video/wayland/SDL_waylandevents.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index cb3de128c98c0e..e635f27e550812 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -44,6 +44,7 @@ #include "tablet-unstable-v2-client-protocol.h" #include "primary-selection-unstable-v1-client-protocol.h" #include "webos-input-manager-client-protocol.h" +#include "starfish-client-protocol.h" #ifdef HAVE_LIBDECOR_H #include @@ -2776,6 +2777,14 @@ int Wayland_input_lock_pointer(struct SDL_WaylandInput *input) SDL_Window *window; struct zwp_relative_pointer_v1 *relative_pointer; +#ifdef SDL_VIDEO_DRIVER_WAYLAND_WEBOS + if (d->starfish_pointer) { + SDL_Mouse *mouse = SDL_GetMouse(); + wl_starfish_pointer_set_cursor_position(d->starfish_pointer, mouse->x, mouse->y); + return 0; + } +#endif + if (!d->relative_pointer_manager) { return -1; }