Hello,

I find that the small patch below makes scrolling by setting mouse at the bottom of the screen much smoother. The question is whether the performance is good enough on slower systems. I guess there is a way to measure that drawing requires more time than the inter-event duration, but I am not sure how.

So, especially if you have a slow-ish computer, please test.

JMarc

PS: the profiler tells me that more than 10% of this time is lost updating macros over and over. I'll take a look at that.
From 9da312f269b2ab3060d1b4231a82dc36787fd45a Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Sat, 20 Jul 2024 19:47:32 +0200
Subject: [PATCH] WIP: make scrolling smoother

This trivial patch makes scrolling-by-selection smoother by dividing
the step size and the time between steps by 8 when generating
synthetic events in work area.
---
 src/frontends/qt/GuiWorkArea.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp
index 462fabda1e..4dfd365d79 100644
--- a/src/frontends/qt/GuiWorkArea.cpp
+++ b/src/frontends/qt/GuiWorkArea.cpp
@@ -943,6 +943,8 @@ void GuiWorkArea::generateSyntheticMouseEvent()
 				step = 80000 / (time * time);
 				time = 40;
 			}
+			step /= 8;
+			time /= 8;
 		}
 		d->synthetic_mouse_event_.timeout.setTimeout(time);
 		d->synthetic_mouse_event_.timeout.start();
-- 
2.43.0

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to