[server,shadow] fix x11_shadow_query_cursor

the coordinates must be clamped to positive values.
This commit is contained in:
akallabeth
2025-03-27 10:53:10 +01:00
parent 9961deb8e6
commit 40b162736c

View File

@@ -625,8 +625,8 @@ static int x11_shadow_query_cursor(x11ShadowSubsystem* subsystem, BOOL getImage)
if ((x != (INT64)subsystem->common.pointerX) || (y != (INT64)subsystem->common.pointerY))
{
subsystem->common.pointerX = WINPR_ASSERTING_INT_CAST(UINT32, x);
subsystem->common.pointerY = WINPR_ASSERTING_INT_CAST(UINT32, y);
subsystem->common.pointerX = (UINT32)MAX(0, x);
subsystem->common.pointerY = (UINT32)MAX(0, y);
x11_shadow_pointer_position_update(subsystem);
}