[client] wayland: update absolute mouse position

We are actually getting mouse events directly from Wayland instead of going
through SDL, so we call app_updateCursorPos in pointer motion handlers and
swallow the SDL event.

Also removed parameters for app_handleMouseBasic as it relies exclusively on
absolute positions provided by app_updateCursorPos. Wayland does not give
you relative movements at all unless grabbed and passing absolute movements
is semantically incorrect.

Note that when the cursor is grabbed, movements are handled entirely through
relativePointerMotionHandler in wayland.c and does not go through
app_handleMouseBasic at all.
This commit is contained in:
Quantum authored and Geoffrey McRae committed 2021-01-16 21:40:24 +11:00
1 parent 0690eacc9b
commit 078a151e4f
3 files changed
+8 -20

No files matched your search

+1 -9
View File
@@ -1103,16 +1103,8 @@ void app_handleMouseNormal(double ex, double ey)
// cursor warp support. Instead, we attempt a best-effort emulation which works
// with a 1:1 mouse movement patch applied in the guest. For anything fancy, use
// capture mode.
void app_handleMouseBasic(double ex, double ey)
void app_handleMouseBasic()
{
/* if we don't have the current cursor pos just send cursor movements */
if (!g_cursor.guest.valid)
{
if (g_cursor.grab)
app_handleMouseGrabbed(ex, ey);
return;
}
const bool inView =
g_cursor.pos.x >= g_state.dstRect.x &&
g_cursor.pos.x < g_state.dstRect.x + g_state.dstRect.w &&