GTK scrollbar fix

31 views
Skip to first unread message

Neil Hodgson

unread,
Aug 14, 2020, 8:02:08 PM8/14/20
to Scintilla mailing list
Bug #2196 discusses a bug with scrollbars not updating on GTK 3. I have seen this issue intermittently and managed to reproduce it on Ubuntu 20.04 by loading a file from the SciTE command line - using the open dialog made the bug disappear.

There is a potential fix attached to the bug and I’d like to hear from others if the patch works and if it changes behaviour in other ways before committing it.

https://sourceforge.net/p/scintilla/bugs/2196/

Neil

Andreas Ronnquist

unread,
Aug 15, 2020, 8:54:12 AM8/15/20
to scintilla...@googlegroups.com
On Sat, 15 Aug 2020 10:02:03 +1000,
'Neil Hodgson' via
I am sorry to say that for me the patch doesn't work as I think it
should. Applying the patch - If I do

scite ~/.bashrc

all looks fine - but as soon as I move the mouse over the SciTE window
the scrollbar changes size (not a major problem, but...) - then
clicking on the window, pressing Page Down once - The scrollbar doesn't
move - _until_ I move the mouse over the scrollbar. It's like the
scrollbar doesn't get updated properly. The arrowbuttons at the top and
bottom in the scrollbar seems to do get updated properly - The
up-button get's deactived and non-clickable if I am at the top of the
text, even if the scrollbar isn't at the top, but the actual scrollbar
seems to not get updated until I move the mouse over it.

I just noticed that the About dialog shows the exact same behaviour -
I guess that also uses a Scintilla component.

This is on Debian Stable, Xfce, GTK 3.24.5.

It's different than the behaviour before the patch, but not quite there
yet.

I'll see if I can make a screencast to better describe the behaviour.

-- Andreas Rönnquist
mailin...@gusnan.se
and...@ronnquist.net

Neil Hodgson

unread,
Aug 17, 2020, 3:20:12 AM8/17/20
to Scintilla mailing list
Andreas Ronnquist:

clicking on the window, pressing Page Down once - The scrollbar doesn't
move - _until_ I move the mouse over the scrollbar. It's like the
scrollbar doesn't get updated properly.

   I can reproduce this.

   The patch changes the behaviour to often be worse. Previously, resizing the window would make it OK (at least temporarily) but with the patch the scrollbar remains buggy.

   Tried a lot of things like asking for the scrollbar to redraw but that doesn’t work.

   Its possible the initialization sequence is incorrect with the scrollbar or adjustment being modified before it is ready. However, several different reorganizations like delaying the scrollbars until the main widget is mapped did not help. 

   In some circumstances, the scrollbar position can be updated by changing another aspect of the adjustment. Changing the maximum position worked but changing the page size by a tiny amount may have fewer side effects. Just after the gtk_adjustment_set_value in ScintillaGTK::SetVerticalScrollPos add:

gtk_adjustment_set_page_size(GTK_ADJUSTMENT(adjustmentv), LinesOnScreen() + 0.00001);

   An aspect of this that I don’t understand is that Scintilla sometimes gets size_allocate signals after changing the scroll position despite its size remaining the same.

   Neil

Reply all
Reply to author
Forward
0 new messages