Fix X11 touchpad scrolling in elastic views - #339
Conversation
Normalize smooth wheel input while preserving ordinary wheel behavior; retain fractional deltas and report the visible viewport to QScroller.
|
|
||
| constexpr auto kDefaultWheelScrollLines = 3; | ||
| constexpr auto kMagicScrollMultiplier = 2.5; | ||
| constexpr auto kX11SmoothScrollMultiplier = 5.; |
There was a problem hiding this comment.
Why exactly that multilplier?
There was a problem hiding this comment.
I had tested different, this one make it works acceptable enough.
| x11Touchpad = e->device() | ||
| && e->device()->type() == base::TouchDevice::TouchPad; | ||
| #endif // Qt >= 6.0.0 | ||
| const auto x11Smooth = !touch |
There was a problem hiding this comment.
Why the current capability check doesn't suffice?
| const auto x11Smooth = !touch | ||
| && ::Platform::IsX11() | ||
| && (pixelInput || !pixelDelta.isNull() || x11Touchpad); | ||
| if (x11Smooth && !angleDelta.isNull()) { |
There was a problem hiding this comment.
You're requiring both pixel delta and angle delta to be not null for the angle delta codepath?
| * kX11SmoothScrollMultiplier) | ||
| / float64(QWheelEvent::DefaultDeltasPerStep); | ||
| } | ||
| if (pixelInput || (x11Smooth && !pixelDelta.isNull())) { |
There was a problem hiding this comment.
You already checked pixelDelta in the x11Smooth check?
| } | ||
| if (pixelInput || (x11Smooth && !pixelDelta.isNull())) { | ||
| return (::Platform::IsX11() && !touch | ||
| ? QPointF(pixelDelta) |
There was a problem hiding this comment.
You're breaking scrolling with scaling for X11 users
There was a problem hiding this comment.
I'm doubt you reach that line at all so I don't think you see the consequences of this change. Can you confirm you actually reach it?
There was a problem hiding this comment.
You're breaking scrolling with scaling for X11 users
You broke the whole scroll using ElasticScroll() on Xenocara, ironic...
There was a problem hiding this comment.
Why? What's the problem with it on Xenocara?
There was a problem hiding this comment.
Why? What's the problem with it on Xenocara?
Do you understand the context of what people are saying to you?
It's completely broken on Xenocara, without this patch, it's impossible to scroll normally.
There was a problem hiding this comment.
Do you understand the context of what people are saying to you?
No, I don't. I don't even know what Xenocara is (sounds like some X-on-X server?) and why ElasticScroll is broken on it.
It's completely broken on Xenocara, without this patch, it's impossible to scroll normally.
This patch looks broken, I asked author to at least explain what each change does but he disappeared... If it's merged as it is, it will maybe fix scroll on Xenocara but will definitely break scrolling on standard Xorg server.
| if (phase == Qt::ScrollBegin) { | ||
| _wheelDeltaRemainder = {}; | ||
| } | ||
| auto exactPixels = ScrollDeltaF(e, touch); |
|
And yes, it is really help. This patch is included into tdesktop in OpenBSD ports, and I do have some positive reports that scroll finally works. Not perfect, but better. |
While currently it doesn't work at all? |
|
Currently it works, but it is extreamly sensetive, and any scroll moves to many messages up/down and make usage nearly impossible. Scroll in contancts, not chat, was broken for a while, but in chats it was broken recently, like a month or two. |
|
Can you answer each question in review? I'm not sure all changes are necessary and right. |
|
@ilya-fedin I'll do it, but I need some time to recover context. |
Normalize smooth wheel input while preserving ordinary wheel behavior; retain fractional deltas and report the visible viewport to QScroller.