From 48cf0996383de37747f068d07e8d35f301fa36d7 Mon Sep 17 00:00:00 2001 From: Shootfast Date: Fri, 4 Mar 2022 19:49:50 +0000 Subject: [PATCH] [client] input: fix confine_pointer argument marshalling Under Wayland, if the mouse pointer is disconnected whilst captured (like say via KVM switch), the waylandWarpPointer code will be called but the pointer will be NULL. This results in the cryptic message: error marshalling arguments for confine_pointer (signature noo?ou): null value passed for arg 2 Error marshalling request: Invalid argument This patch adds a check on the wlWm.pointer pointer before attempting to warp the pointer, and avoids the crash. --- AUTHORS | 1 + client/displayservers/Wayland/input.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index b336d217..ddf88091 100644 --- a/AUTHORS +++ b/AUTHORS @@ -58,3 +58,4 @@ RTXUX (RTXUX) Vincent LaRocca (VMFortress) Johnathon Paul Weaver (8BallBomBom) Chris Spencer (spencercw) +Mark Boorer (Shootfast) diff --git a/client/displayservers/Wayland/input.c b/client/displayservers/Wayland/input.c index fe9e1c9d..2f02c45c 100644 --- a/client/displayservers/Wayland/input.c +++ b/client/displayservers/Wayland/input.c @@ -616,7 +616,10 @@ void waylandRealignPointer(void) void waylandGuestPointerUpdated(double x, double y, double localX, double localY) { - if (!wlWm.warpSupport || !wlWm.pointerInSurface || wlWm.lockedPointer) + if ( !wlWm.pointer || + !wlWm.warpSupport || + !wlWm.pointerInSurface || + wlWm.lockedPointer ) return; waylandWarpPointer((int) localX, (int) localY, false);