From 1a8dfe1cc0a5639255656d1309d99dee4ddc2af4 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 4 Dec 2020 17:36:08 +1100 Subject: [PATCH] [client] spice: only check for a valid position if needed --- client/src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/main.c b/client/src/main.c index a0dd5426..2d98b88e 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -905,9 +905,9 @@ static void handleMouseMoveEvent(int ex, int ey) }; /* check if the movement would exit the window */ - if (isValidCursorLocation(pos.x, pos.y) && - (newPos.x < 0 || newPos.x >= state.dstRect.w || - newPos.y < 0 || newPos.y >= state.dstRect.h)) + if ((newPos.x < 0 || newPos.x >= state.dstRect.w || + newPos.y < 0 || newPos.y >= state.dstRect.h) && + isValidCursorLocation(pos.x, pos.y)) { /* determine where to move the cursor to taking into account any borders * if the aspect ratio is not being forced */