Ignore SDL_MOUSEBUTTONDOWN events incompatible with SPICE (#38)

* Ignore SDL_MOUSEBUTTONDOWN events that aren't compatible with the SPICE PS/2 mouse
This commit is contained in:
Aaron 2018-01-14 17:55:17 -06:00 committed by Geoffrey McRae
parent a02087e5e4
commit 3d9d275d61

View File

@ -587,6 +587,9 @@ int eventThread(void * arg)
} }
case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONDOWN:
// The SPICE protocol doesn't support more than a standard PS/2 3 button mouse
if (event.button.button > 3)
break;
if ( if (
!spice_mouse_position(event.button.x, event.button.y) || !spice_mouse_position(event.button.x, event.button.y) ||
!spice_mouse_press(event.button.button) !spice_mouse_press(event.button.button)
@ -598,6 +601,9 @@ int eventThread(void * arg)
break; break;
case SDL_MOUSEBUTTONUP: case SDL_MOUSEBUTTONUP:
// The SPICE protocol doesn't support more than a standard PS/2 3 button mouse
if (event.button.button > 3)
break;
if ( if (
!spice_mouse_position(event.button.x, event.button.y) || !spice_mouse_position(event.button.x, event.button.y) ||
!spice_mouse_release(event.button.button) !spice_mouse_release(event.button.button)
@ -1418,4 +1424,4 @@ int main(int argc, char * argv[])
return ret; return ret;
} }