Skip to content

Commit

Permalink
don't send mouse move for touch mouse
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Feb 28, 2024
1 parent c73f17b commit 7030272
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/app/stream/input/session_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
#include <SDL.h>

void stream_input_handle_mbutton(stream_input_t *input, const SDL_MouseButtonEvent *event) {
int button = 0;
(void) input;
int button;
switch (event->button) {
case SDL_BUTTON_LEFT:
button = BUTTON_LEFT;
Expand Down Expand Up @@ -50,10 +51,10 @@ void stream_input_handle_mmotion(stream_input_t *input, const SDL_MouseMotionEve
if (input->view_only || input->no_sdl_mouse) {
return;
}
if (app_get_mouse_relative()) {
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, input->session->display_width,
input->session->display_height);
LiSendMousePositionEvent((short) event->x, (short) event->y, (short) input->session->display_width,
(short) input->session->display_height);
}
}

0 comments on commit 7030272

Please sign in to comment.