Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/neutrinolabs/xorgxrdp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetalefty <meta@vmeta.jp>2022-09-05 15:25:03 +0300
committerGitHub <noreply@github.com>2022-09-05 15:25:03 +0300
commit6b56cbc1f01d17c4b61b106f92bcc2a7b62fae2f (patch)
treeac9166e347877dab8325e6ce18cf9d1f6665f7b7
parent65d9a405af80d697ec5226912633a926bdb9c9d7 (diff)
parenta122beb95044f36405339cbb4a7e49475b9b2237 (diff)
Merge pull request #227 from metalefty/scroll-workaround
mouse: workaround for too fast vertical scroll
-rw-r--r--module/rdp.h2
-rw-r--r--module/rdpClientCon.c20
-rw-r--r--module/rdpInput.c24
3 files changed, 46 insertions, 0 deletions
diff --git a/module/rdp.h b/module/rdp.h
index 125c7d9..66e1f20 100644
--- a/module/rdp.h
+++ b/module/rdp.h
@@ -288,6 +288,7 @@ struct _rdpRec
int do_dirty_ons; /* boolean */
int disconnect_scheduled; /* boolean */
int do_kill_disconnected; /* boolean */
+ int do_touchpad_scroll_hack; /* boolean */
OsTimerPtr disconnectTimer;
int disconnect_timeout_s;
@@ -296,6 +297,7 @@ struct _rdpRec
OsTimerPtr idleDisconnectTimer;
int idle_disconnect_timeout_s;
CARD32 last_event_time_ms;
+ CARD32 last_wheel_time_ms;
int conNumber;
diff --git a/module/rdpClientCon.c b/module/rdpClientCon.c
index e4e0317..504d261 100644
--- a/module/rdpClientCon.c
+++ b/module/rdpClientCon.c
@@ -1473,6 +1473,26 @@ rdpClientConInit(rdpPtr dev)
LLOGLN(0, ("rdpClientConInit: kill disconnected [%d] timeout [%d] sec",
dev->do_kill_disconnected, dev->disconnect_timeout_s));
+ /* neutrinolabs/xorgxrdp#150 */
+ ptext = getenv("XRDP_XORG_TOUCHPAD_SCROLL_HACK");
+ if (ptext != 0)
+ {
+ i = atoi(ptext);
+ if (i != 0 ||
+ 0 == strcasecmp(ptext, "true") ||
+ 0 == strcasecmp(ptext, "yes") ||
+ 0 == strcasecmp(ptext, "on"))
+ {
+ dev->do_touchpad_scroll_hack = 1;
+ }
+ else
+ {
+ dev->do_touchpad_scroll_hack = 0;
+ }
+ }
+
+ LLOGLN(0, ("rdpClientConInit: do_touchpad_scroll_hack [%d]",
+ dev->do_touchpad_scroll_hack));
return 0;
}
diff --git a/module/rdpInput.c b/module/rdpInput.c
index daedf39..edb4b01 100644
--- a/module/rdpInput.c
+++ b/module/rdpInput.c
@@ -115,6 +115,30 @@ rdpInputMouseEvent(rdpPtr dev, int msg,
{
dev->last_event_time_ms = GetTimeInMillis();
+ /*
+ * Workaround for too fast vertical scroll on touchpad.
+ * Provided by @seflerZ on neutrinolabs/xorgxrdp#150
+ */
+ if (dev->do_touchpad_scroll_hack)
+ {
+ if (msg == WM_BUTTON4UP ||
+ msg == WM_BUTTON4DOWN ||
+ msg == WM_BUTTON5UP ||
+ msg == WM_BUTTON5DOWN)
+ {
+
+ if (dev->last_event_time_ms - dev->last_wheel_time_ms < 10)
+ {
+ return 0;
+ }
+ }
+
+ if (msg == WM_BUTTON4UP || msg == WM_BUTTON5UP)
+ {
+ dev->last_wheel_time_ms = dev->last_event_time_ms;
+ }
+ }
+
if (g_input_proc[1].proc != 0)
{
return g_input_proc[1].proc(dev, msg, param1, param2, param3, param4);