[client] spice/wayland: fix capture mode relative movement

It appears that Wayland pointer motion handlers are called even when relative
mouse mode is enabled. The events they generate break first-person games.
This commit disables those handlers when relative mouse is enabled.
This commit is contained in:
Quantum 2021-01-17 23:13:19 -05:00 committed by Geoffrey McRae
parent 3935acf8a5
commit ff1dc32efe

View File

@ -123,6 +123,9 @@ static const struct wl_registry_listener registryListener = {
static void pointerMotionHandler(void * data, struct wl_pointer * pointer, static void pointerMotionHandler(void * data, struct wl_pointer * pointer,
uint32_t serial, wl_fixed_t sxW, wl_fixed_t syW) uint32_t serial, wl_fixed_t sxW, wl_fixed_t syW)
{ {
if (wm.relativePointer)
return;
int sx = wl_fixed_to_int(sxW); int sx = wl_fixed_to_int(sxW);
int sy = wl_fixed_to_int(syW); int sy = wl_fixed_to_int(syW);
app_updateCursorPos(sx, sy); app_updateCursorPos(sx, sy);
@ -133,6 +136,9 @@ static void pointerEnterHandler(void * data, struct wl_pointer * pointer,
uint32_t serial, struct wl_surface * surface, wl_fixed_t sxW, uint32_t serial, struct wl_surface * surface, wl_fixed_t sxW,
wl_fixed_t syW) wl_fixed_t syW)
{ {
if (wm.relativePointer)
return;
int sx = wl_fixed_to_int(sxW); int sx = wl_fixed_to_int(sxW);
int sy = wl_fixed_to_int(syW); int sy = wl_fixed_to_int(syW);
app_updateCursorPos(sx, sy); app_updateCursorPos(sx, sy);