From c6af5be1dcb3c9467a656d3a2db7124428c55a05 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 2 Feb 2021 09:36:01 +1100 Subject: [PATCH] [client] app: always track the mouse button state This change fixes a bug on re-grab of the cursor if window focus was lost while a mouse button was held. --- client/src/app.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/app.c b/client/src/app.c index ad7c52a4..69d6e28c 100644 --- a/client/src/app.c +++ b/client/src/app.c @@ -163,22 +163,22 @@ void spiceClipboardNotice(const SpiceDataType type) void app_handleButtonPress(int button) { + g_cursor.buttons |= (1U << button); + if (!core_inputEnabled() || !g_cursor.inView) return; - g_cursor.buttons |= (1U << button); - if (!spice_mouse_press(button)) DEBUG_ERROR("app_handleButtonPress: failed to send message"); } void app_handleButtonRelease(int button) { + g_cursor.buttons &= ~(1U << button); + if (!core_inputEnabled()) return; - g_cursor.buttons &= ~(1U << button); - if (!spice_mouse_release(button)) DEBUG_ERROR("app_handleButtonRelease: failed to send message"); }