1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
From: Pascal Nowack <Pascal.Nowack@gmx.de>
Date: Mon, 8 Feb 2021 13:21:57 +0100
Subject: Revert "rdp/event: Fix wheel value for GDK_SCROLL_DOWN events"
RDP actually uses the two's complement. The change in that commit was
actually wrong, so revert it.
This reverts commit 4a546fac38152424f45c47d96d5bf177eb17782b.
---
plugins/rdp/rdp_event.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/plugins/rdp/rdp_event.c b/plugins/rdp/rdp_event.c
index 66d6053..dcf0167 100644
--- a/plugins/rdp/rdp_event.c
+++ b/plugins/rdp/rdp_event.c
@@ -580,7 +580,7 @@ static gboolean remmina_rdp_event_on_scroll(GtkWidget* widget, GdkEventScroll* e
break;
case GDK_SCROLL_DOWN:
- flag = PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x0078; // -120 (one scroll unit)
+ flag = PTR_FLAGS_WHEEL | 0x0188; // -120 (one scroll unit) in 9 bits two's complement
break;
#if GTK_CHECK_VERSION(3, 4, 0)
@@ -593,16 +593,10 @@ static gboolean remmina_rdp_event_on_scroll(GtkWidget* widget, GdkEventScroll* e
if (windows_delta > 255)
windows_delta = 255;
- if (windows_delta < -255)
- windows_delta = -255;
+ if (windows_delta < -256)
+ windows_delta = -256;
- flag = PTR_FLAGS_WHEEL;
-
- if (windows_delta < 0) {
- windows_delta = -windows_delta;
- flag |= PTR_FLAGS_WHEEL_NEGATIVE;
- }
- flag |= (short)windows_delta & 0xFF;
+ flag = PTR_FLAGS_WHEEL | ((short)windows_delta & WheelRotationMask);
break;
#endif
|