Recent

Author Topic: SynEdit/DrawGrid scrolling bug in Cocoa  (Read 698 times)

VTwin

  • Hero Member
  • *****
  • Posts: 775
  • Former Turbo Pascal 3 user
SynEdit/DrawGrid scrolling bug in Cocoa
« on: August 19, 2019, 01:55:25 am »
SynEdit seems to have a bug with scrolling. It is evident in the IDE. Open a file and try to scroll to the bottom using a scroll pad. It scrolls, but then jumps back to the top.

The scrollbars work as expected.

Anyone else notice this?

EDIT: It seems to effect DrawGrid as well.
« Last Edit: August 23, 2019, 01:08:45 am by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4

JdeHaan

  • New Member
  • *
  • Posts: 24
Re: SynEdit scrolling bug in Cocoa
« Reply #1 on: August 19, 2019, 08:35:22 am »
Same here,
scrolling with trackpad, when releasing trackpad, jumps back to top.
on trunk Cocoa 64 bit (Mojave 10.14.6). FPC 3.3.1, Laz 2.1.0, R61717

It doesn't happen in latest release 2.04 Darwin 32 bit

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2268
    • havefunsoft.com
Re: SynEdit scrolling bug in Cocoa
« Reply #2 on: August 21, 2019, 05:02:41 pm »
please try r61741
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

VTwin

  • Hero Member
  • *****
  • Posts: 775
  • Former Turbo Pascal 3 user
Re: SynEdit scrolling bug in Cocoa
« Reply #3 on: August 21, 2019, 05:17:07 pm »
Thanks. I just did, it is not fixed though.

Something is a little different in the IDE, it sometimes does not jump back to the top, but still does most of the time.

Attached is a project exhibiting the behavior in a DrawGrid if that helps.
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4

VTwin

  • Hero Member
  • *****
  • Posts: 775
  • Former Turbo Pascal 3 user
Re: SynEdit scrolling bug in Cocoa
« Reply #4 on: August 21, 2019, 05:29:21 pm »
I just realized that in DrawGrid (and IDE) you drag RIGHT to scroll right. I believe the correct convention is to drag LEFT to scroll right, as if you were dragging a piece of paper.

The DrawGrid is, correctly (I believe), trying to scroll down when you drag UP, which is  the opposite convention than the (incorrect) left-right scrolling. 

Perhaps the problem is related?

 
« Last Edit: August 21, 2019, 05:32:52 pm by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2268
    • havefunsoft.com
Re: SynEdit scrolling bug in Cocoa
« Reply #5 on: August 21, 2019, 05:32:27 pm »
...a trackpad then.

It's all related to changes in CustomControl structure. Where the custromcontrol is now residing in NSScrollView. It seems like the scrolling via trackpad is not properly forwarded/handled.
« Last Edit: August 21, 2019, 05:34:32 pm by skalogryz »
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

VTwin

  • Hero Member
  • *****
  • Posts: 775
  • Former Turbo Pascal 3 user
Re: SynEdit scrolling bug in Cocoa
« Reply #6 on: August 21, 2019, 05:33:59 pm »
...a trackpad then.

Yes, I am using the pad on a [edit] Mac Book Pro. I have not verified with  mouse. I may be able to when I get to work later.
« Last Edit: August 21, 2019, 05:54:03 pm by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4

VTwin

  • Hero Member
  • *****
  • Posts: 775
  • Former Turbo Pascal 3 user
Re: SynEdit scrolling bug in Cocoa
« Reply #7 on: August 23, 2019, 01:04:50 am »
I did not get a chance to verify this bug with a mouse yet. Can anyone else confirm? It would be much appreciated.

I'm in a bit of a bind because I released 3 programs last week that use DrawGrids as primary data display, and they all show this behavior. It looks pretty bad to my users.

Cheers,
VTwin
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2268
    • havefunsoft.com
Re: SynEdit/DrawGrid scrolling bug in Cocoa
« Reply #8 on: August 23, 2019, 03:47:27 am »
mouse works fine. I don't see any scrolling "jumps" with the mouse.

I'm in a bit of a bind because I released 3 programs last week that use DrawGrids as primary data display, and they all show this behavior. It looks pretty bad to my users.
Sorry to hear that. :(
The unfortunate of the lack of resources is that the end users tend to do the quality assurance.

You might want to switch your macOS development tactics.
- don't use trunk, but use "fixes" branch.
- request to merge updates to "fixes" branch as you make sure they work properly in trunk.
That should safeguard you from "untested" changes.
« Last Edit: August 23, 2019, 03:52:07 am by skalogryz »
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

VTwin

  • Hero Member
  • *****
  • Posts: 775
  • Former Turbo Pascal 3 user
Re: SynEdit/DrawGrid scrolling bug in Cocoa
« Reply #9 on: August 24, 2019, 05:04:48 pm »
Many thanks. I started using trunk a while back when it seemed like I needed the latest Cocoa modifications.

I've just installed Laz 2.0.4 Carbon to compile for Cocoa:

https://wiki.lazarus.freepascal.org/Installing_Lazarus_on_MacOS_X#Cocoa_64_bit_vs_Carbon_32_bit

This does not show the "jumping" behavior when scrolling. I will work with that release for now, and then may use the fixes branch if necessary. I will also keep a trunk version to test any new modifications.


Note that the left-right scrolling behavior is correct in the Carbon IDE (drag left to scroll right), but is still opposite (drag right to scroll right) in the Cocoa demo that I posted. This seems to be a bug.
 
« Last Edit: August 24, 2019, 05:16:35 pm by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4

VTwin

  • Hero Member
  • *****
  • Posts: 775
  • Former Turbo Pascal 3 user
Re: SynEdit/DrawGrid scrolling bug in Cocoa
« Reply #10 on: August 26, 2019, 11:39:43 pm »
In case anyone is following this thread, I already migrated to 2.0 fixes as a number of Cocoa issues are fixed.
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2268
    • havefunsoft.com
Re: SynEdit/DrawGrid scrolling bug in Cocoa
« Reply #11 on: August 28, 2019, 04:28:26 am »
please trunk!
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

JdeHaan

  • New Member
  • *
  • Posts: 24
Re: SynEdit/DrawGrid scrolling bug in Cocoa
« Reply #12 on: August 28, 2019, 07:50:06 am »
Just installed Lazarus Cocoa trunk and it's solved!
Trackpad scrolling is working as expected on Mac (OS 10.14.6).

Thanks Skalogryz!

VTwin

  • Hero Member
  • *****
  • Posts: 775
  • Former Turbo Pascal 3 user
Re: SynEdit/DrawGrid scrolling bug in Cocoa
« Reply #13 on: October 01, 2019, 03:23:08 pm »
Excellent, the trackpad is working as expected in trunk. Thanks!

Not yet in fixes.
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.13.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4