From 1cf90ae31d5acb6d945f3e8011f3476dde75eafc Mon Sep 17 00:00:00 2001 From: Hrvoje Cavrak Date: Sun, 24 Mar 2024 22:05:05 +0100 Subject: [PATCH] Fixed a mouse.c issue with some compilers. --- src/mouse.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mouse.c b/src/mouse.c index 7ee8a9c..2801b5f 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -132,17 +132,16 @@ void switch_screen( } void switch_desktop(device_t *state, output_t *output, int new_index, int direction) { + /* Fix for MACOS: Send relative mouse movement here, one or two pixels in the + direction of movement, BEFORE absolute report sets X to 0 */ + mouse_report_t move_relative_one + = {.x = (direction == LEFT) ? 16384 - 2 : 16384 + 2, .mode = RELATIVE}; + switch (output->os) { case MACOS: - /* Send relative mouse movement here as well, one or two pixels in the direction of - movement, BEFORE absolute report sets X to 0 */ - mouse_report_t move_relative_one - = {.x = (direction == LEFT) ? 16384 - 2 : 16384 + 2, .mode = RELATIVE}; - /* Once doesn't seem reliable enough, do it twice */ output_mouse_report(&move_relative_one, state); output_mouse_report(&move_relative_one, state); - break; case WINDOWS: