racket / drracket

DrRacket, IDE for Racket
http://www.racket-lang.org/
Other
452 stars 94 forks source link

Trackpad two-finger scrolling does not work all the way to the end #474

Closed ghost closed 2 years ago

ghost commented 3 years ago

Dr. Racket version: 8.0 OS: Windows 10 pro 20H2 Machine: Packard Bell Easynote LV 11 HC

How to reproduce the problem

  1. Open the Package manager;
  2. go to the "Currently installed" or "Available from catalog" tabs;
  3. try to scroll the list of packages with two fingers on the trackpad.

The list will not scroll all the way to the end, but it will get stuck near the beginning. On the other hand, if you use the scrollbar (in the "Currently installed" tab) and go to the end, then try to two-finger scroll to the beginning, the list will get stuck in nearly the same place; If you scroll with the scrollbar to the end of the list in the "Available from catalog" tab then two-finger scroll all the way up, it seems that two-finger scrolling starts to work properly.

This issue seems to be related to #246 and #233.

Here is a gif that shows the issue in practice: drracketpmnotscrolling4

DexterLagan commented 2 years ago

This issue is not limited to touchpads, I'm having the same problem with a regular mouse scroll wheel on Windows for the list-box control. On my system (Windows 11) scrolling any racket list-box does not work correctly, it doesn't reach the bottom of the list. Somehow the problem disappears when resizing the list-box or maximizing the parent window. This is becoming a problem as many of our internal apps use the list-box. Our staff has been complaining about this problem for a while. I'm currently looking for a version of Racket that doesn't exhibit the problem. I have tried 8.6 release, 8.6.0.2 and 8.6.0.9, and all have the same scrolling problem.

DexterLagan commented 2 years ago

I found a way to temporarily fix the problem by clicking once on the scrollbar. List-box exhibits the same problem if resized.

mflatt commented 2 years ago

On line 414 of "share/pkgs/gui-lib/mred/private/wx/win32/list-box.rkt", there's a (unless (= c i) ...). I don't know why that's there, and I can't make any sense of it at the moment. Does scrolling work better if you change (= c i) to just #f?

DexterLagan commented 2 years ago

I'll give it a try and get back to you. Thanks Matthew!

DexterLagan commented 2 years ago

Good news: it seems to be fixing the problem on both my Win systems (win11 and win10). Scrolling still locks up for maybe 50-100ms every couple wheel turns, but it works all the way to the end. Thanks again.

mflatt commented 2 years ago

Ok, thanks for trying it! I'll push this repair.

DexterLagan commented 2 years ago

Matt I'm getting this error once in a while within DrRacket since the temporary patch:

scroll-line-location method of text%: expects argument of type ; given: -1 context...: C:\Program Files (x86)\Racket-8.6.0.9\share\pkgs\gui-lib\mred\private\wxme\text.rkt:3663:2: scroll-line-location method in text% C:\Program Files (x86)\Racket-8.6.0.9\share\pkgs\gui-lib\mred\private\wxme\text.rkt:1054:2: move-position method in text% C:\Program Files (x86)\Racket-8.6.0.9\share\pkgs\gui-lib\mred\private\wxme\text.rkt:6070:21: send-arg3811 C:\Program Files (x86)\Racket-8.6.0.9\share\pkgs\gui-lib\mred\private\wxme\keymap.rkt:511:2: chain-handle-key-event method in keymap% [repeats 2 more times] C:\Program Files (x86)\Racket-8.6.0.9\share\pkgs\gui-lib\mred\private\wxme\keymap.rkt:462:2: handle-key-event method in keymap% C:\Program Files (x86)\Racket-8.6.0.9\share\pkgs\gui-lib\mred\private\wxme\editor.rkt:215:2: on-local-char method in editor% C:\Program Files (x86)\Racket-8.6.0.9\collects\racket\private\more-scheme.rkt:148:2: call-with-break-parameterization C:\Program Files (x86)\Racket-8.6.0.9\share\pkgs\gui-lib\mred\private\wxme\editor-canvas.rkt:504:2: on-char method in editor-canvas% C:\Program Files (x86)\Racket-8.6.0.9\collects\racket\private\more-scheme.rkt:266:2: call-with-exception-handler C:\Program Files (x86)\Racket-8.6.0.9\share\pkgs\gui-lib\mred\private\wx\win32\window.rkt:818:2: dispatch-on-char method in window% C:\Program Files (x86)\Racket-8.6.0.9\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:435:6 C:\Program Files (x86)\Racket-8.6.0.9\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:486:32 C:\Program Files (x86)\Racket-8.6.0.9\share\pkgs\gui-lib\mred\private\wx\common\dialog.rkt:58:4: show method in dialog-mixin C:\Program Files (x86)\Racket-8.6.0.9\collects\racket\private\more-scheme.rkt:148:2: call-with-break-parameterization C:\Program Files (x86)\Racket-8.6.0.9\collects\racket\private\more-scheme.rkt:266:2: call-with-exception-handler