[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.
This commit is contained in:
Shootfast 2022-03-04 19:49:50 +00:00 committed by Geoffrey McRae
parent 88d60d4b3d
commit 48cf099638
2 changed files with 5 additions and 1 deletions

View File

@ -58,3 +58,4 @@ RTXUX <wyf@rtxux.xyz> (RTXUX)
Vincent LaRocca <vincentmlarocca@gmail.com> (VMFortress) Vincent LaRocca <vincentmlarocca@gmail.com> (VMFortress)
Johnathon Paul Weaver <weaver123_johnathon@hotmail.com> (8BallBomBom) Johnathon Paul Weaver <weaver123_johnathon@hotmail.com> (8BallBomBom)
Chris Spencer <spencercw@gmail.com> (spencercw) Chris Spencer <spencercw@gmail.com> (spencercw)
Mark Boorer <markboo99@gmail.com> (Shootfast)

View File

@ -616,7 +616,10 @@ void waylandRealignPointer(void)
void waylandGuestPointerUpdated(double x, double y, double localX, double localY) 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; return;
waylandWarpPointer((int) localX, (int) localY, false); waylandWarpPointer((int) localX, (int) localY, false);