diff --git a/src/app/stream/input/session_evmouse.c b/src/app/stream/input/session_evmouse.c index 1e886348..f5f044a3 100644 --- a/src/app/stream/input/session_evmouse.c +++ b/src/app/stream/input/session_evmouse.c @@ -83,7 +83,7 @@ static void mouse_listener(const evmouse_event_t *event, void *userdata) { break; } case SDL_MOUSEMOTION: { - stream_input_handle_mmotion(&session->input, &event->motion); + stream_input_handle_mmotion(&session->input, &event->motion, true); break; } case SDL_MOUSEWHEEL: { diff --git a/src/app/stream/input/session_input.h b/src/app/stream/input/session_input.h index d23e46d7..d327bde1 100644 --- a/src/app/stream/input/session_input.h +++ b/src/app/stream/input/session_input.h @@ -67,7 +67,7 @@ void stream_input_handle_ctouchpad(stream_input_t *input, const SDL_ControllerTo void stream_input_handle_cdevice(stream_input_t *input, const SDL_ControllerDeviceEvent *event); -void stream_input_handle_mmotion(stream_input_t *input, const SDL_MouseMotionEvent *event); +void stream_input_handle_mmotion(stream_input_t *input, const SDL_MouseMotionEvent *event, bool hw_mouse); void stream_input_handle_mbutton(stream_input_t *input, const SDL_MouseButtonEvent *event); diff --git a/src/app/stream/input/session_mouse.c b/src/app/stream/input/session_mouse.c index cb80db30..6f3114e8 100644 --- a/src/app/stream/input/session_mouse.c +++ b/src/app/stream/input/session_mouse.c @@ -59,19 +59,20 @@ void stream_input_handle_mwheel(stream_input_t *input, const SDL_MouseWheelEvent } } -void stream_input_handle_mmotion(stream_input_t *input, const SDL_MouseMotionEvent *event) { +void stream_input_handle_mmotion(stream_input_t *input, const SDL_MouseMotionEvent *event, bool hw_mouse) { if (input->view_only) { return; } - if (input->no_sdl_mouse) { - LiSendMouseMoveEvent((short) event->xrel, (short) event->yrel); - return; - } if (event->which == SDL_TOUCH_MOUSEID && LiGetHostFeatureFlags() & LI_FF_PEN_TOUCH_EVENTS) { // Don't send mouse events from touch devices if the host supports pen/touch events return; } - if (app_get_mouse_relative() && event->which != SDL_TOUCH_MOUSEID) { + if (input->no_sdl_mouse) { + if (!hw_mouse) { + return; + } + LiSendMouseMoveEvent((short) event->xrel, (short) event->yrel); + } else if (app_get_mouse_relative() && event->which != SDL_TOUCH_MOUSEID) { LiSendMouseMoveEvent((short) event->xrel, (short) event->yrel); } else { LiSendMousePositionEvent((short) event->x, (short) event->y, (short) input->session->display_width, diff --git a/src/app/stream/session_events.c b/src/app/stream/session_events.c index 9bf51e8d..c4961f9a 100644 --- a/src/app/stream/session_events.c +++ b/src/app/stream/session_events.c @@ -37,7 +37,7 @@ bool session_handle_input_event(session_t *session, const SDL_Event *event) { break; } case SDL_MOUSEMOTION: { - stream_input_handle_mmotion(input, &event->motion); + stream_input_handle_mmotion(input, &event->motion, false); break; } case SDL_MOUSEWHEEL: {