Page 1 of 1

Autoscroll problems on Linux

PostPosted: Wed Feb 03, 2021 3:33 am
by cooperised
Thanks so much for CoolTerm - I use it for teaching, because the setup is simple on all platforms and it doesn't get in the way. I have a few minor feature requests which I might drop in here someday, but it's almost perfect for this purpose.

However this is a bug report. On Linux (at least on Ubuntu 20.04, confirmed on multiple machines) the autoscroll doesn't work well. Once the text fills the pane, every new line causes the scrollbar to flicker between the top and bottom of its travel - it seems that the view scrolls to the top and then immediately back to the bottom. If data is arriving quickly, this makes it flicker continuously and renders it unreadable. The only workaround is to set the receive buffer small enough that scrolling doesn't take place, but the required receive buffer size depends on line length so it's not easy to set.

This isn't urgent; most of my students are using Windows or OS X, so this doesn't affect many of them. It affects me, but that's less important! It would be great if there was a fix though. I noticed in the release notes for 1.7.0 "[Win] Improved autoscrolling code to avoid flickering and undesired shifts of the scroll position" - no idea if this is related to this bug of course but it does sound similar.

Thanks again.

Re: Autoscroll problems on Linux

PostPosted: Sat Feb 06, 2021 7:10 pm
by roger

yes the scrolling on Linux is an issue that has plagued me for a long time, and I haven't been able to fix it. I haven't given up yet, though.
In v1.7.0 I was able to address an issue with scrolling in the Windows version (hence the [Win] tag).


Re: Autoscroll problems on Linux

PostPosted: Wed Feb 10, 2021 9:34 am
by cooperised
Thanks for the reply! Glad you're already aware.

Quick question - is the scrolling pane part of the open-source core of CoolTerm? If so I might be able to offer some help fixing it (or at least fiddling with it!) when work calms down a bit.

Re: Autoscroll problems on Linux

PostPosted: Sat Feb 13, 2021 2:01 am
by roger
Yes, I believe the code in the OpenSimpleTerm project ( is very similar. Look for a method called “DisplayData”. That’s the method that dumps the contents of the receive buffer into the text area.

The method overwrites the current contents of the text area with the buffer contents. This causes the text area to scroll to the very top. The code then scrolls the text area to the bottom. On macOS the controls are double buffered, so they don’t update until the end. That’s not the case in Linux where the text area control refreshes twice, first after it automatically scrolls to the top, and then again after the code scrolls the control to the end of the text. That’s what causes the flicker. On Windows I’m using declares to freeze the control before replacing the text contents and then to unfreeze after scrolling to the bottom. That fixes the flicker. I tried to use GTK declares to do the same on Linux, but it seems these calls have no effect. Also, not all Linux distributions have this issue with flicker. It’s pretty bad on Ubuntu, but Centos doesn’t seem to have this problem to that degree.