Bug 519728 - Overlay scroll bar hides last element
Summary: Overlay scroll bar hides last element
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.7   Edit
Hardware: PC Linux
: P3 normal with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted, triaged
: 479226 496828 543990 551411 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-07-15 16:40 EDT by Marcelo Ruiz CLA
Modified: 2020-11-16 12:36 EST (History)
16 users (show)

See Also:


Attachments
Bottom margin on treeview (1.91 KB, image/png)
2020-06-03 15:50 EDT, Soraphol (Paul) Damrongpiriyapong CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcelo Ruiz CLA 2017-07-15 16:40:50 EDT
Horizontal scroll bar in package explorer partially hides last item (if it reaches the bottom of the view) when user moves cursor (like trying to click on it)

-- Configuration Details --
Product: Eclipse 4.7.0.20170620-1800 (org.eclipse.epp.package.rcp.product)Installed Features:
 org.eclipse.jdt 3.13.0.v20170612-0950
Versioning Plugin:
 org.eclipse.platform 4.7.0.v20170612-1255
Comment 1 Stephan Herrmann CLA 2017-07-15 18:19:04 EDT
Yes, selecting the last item in any list or tree can be tricky, if a horizontal scroll bar pops up.

Is this a general GTK issue? 
S.t. Platform/UI can improve? 
Or SWT?
Comment 2 Dani Megert CLA 2017-07-31 05:35:57 EDT
I have no issue with this on Windows 7.
Comment 3 Stephan Herrmann CLA 2017-07-31 06:29:00 EDT
(In reply to Dani Megert from comment #2)
> I have no issue with this on Windows 7.

I see it on Linux GTK all the time and in all views.
Comment 4 Eric Williams CLA 2017-07-31 10:20:43 EDT
(In reply to Stephan Herrmann from comment #3)
> (In reply to Dani Megert from comment #2)
> > I have no issue with this on Windows 7.
> 
> I see it on Linux GTK all the time and in all views.

Which version of GTK are you using?

GTK3.16+ uses overlay scrollbars, which should prevent this issue happening.
Comment 5 Leo Ufimtsev CLA 2017-07-31 15:47:52 EDT
I have this issue in Gtk3.22 as well.
The problem occurs if you move your mouse from the bottom up into a tree-view, trying to select the bottom item.

I think the solution might be to move all items up and leave a small gap at the bottom to accommodate the scroll bar.
Comment 6 Stephan Herrmann CLA 2017-07-31 18:34:00 EDT
(In reply to Eric Williams from comment #4)
> GTK3.16+ uses overlay scrollbars, which should prevent this issue happening.

If "overlay scrollbars" is the concept of scrollbars popping up when the mouse reaches the margin, then it is the cause not the cure of the problem.
Comment 7 Eric Williams CLA 2017-08-03 10:05:44 EDT
(In reply to Stephan Herrmann from comment #6)
> (In reply to Eric Williams from comment #4)
> > GTK3.16+ uses overlay scrollbars, which should prevent this issue happening.
> 
> If "overlay scrollbars" is the concept of scrollbars popping up when the
> mouse reaches the margin, then it is the cause not the cure of the problem.

Ah yes I see what you mean now. I think it would be possible to implement something like in comment 5. I'll prepare a patch.
Comment 8 Eric Williams CLA 2017-08-03 16:41:37 EDT
Fixing this issue isn't as trivial as it seems:

The rendering mechanism for GtkTreeView is GtkCellRenderer. However renderers are attached by column, not by row. This means padding individual items/rows is tricky since any padding changes made to the renderer will apply to the whole tree.

Unfortunately GTK CSS no longer exposes individual rows any more (as of 3.20) so that option isn't available either.

I'm going to investigate the idea of making a "dummy" column, and then just keep track of the last item in the tree. That item will be attached to the dummy column, which allows for padding manipulation without altering the whole tree. 

This wiki touches upon it briefly: https://en.wikibooks.org/wiki/GTK%2B_By_Example/Tree_View/Columns_and_Renderers#How_to_Make_a_Whole_Row_Bold_or_Coloured

Another option is to create a blank TreeItem to append to act as the padding and just keep it at the end of the tree.

I'll continue to investigate.
Comment 9 Eric Williams CLA 2017-09-05 13:04:35 EDT
(In reply to Eric Williams from comment #8)
> Fixing this issue isn't as trivial as it seems:
> 
> The rendering mechanism for GtkTreeView is GtkCellRenderer. However
> renderers are attached by column, not by row. This means padding individual
> items/rows is tricky since any padding changes made to the renderer will
> apply to the whole tree.
> 
> Unfortunately GTK CSS no longer exposes individual rows any more (as of
> 3.20) so that option isn't available either.
> 
> I'm going to investigate the idea of making a "dummy" column, and then just
> keep track of the last item in the tree. That item will be attached to the
> dummy column, which allows for padding manipulation without altering the
> whole tree. 
> 
> This wiki touches upon it briefly:
> https://en.wikibooks.org/wiki/GTK%2B_By_Example/Tree_View/
> Columns_and_Renderers#How_to_Make_a_Whole_Row_Bold_or_Coloured
> 
> Another option is to create a blank TreeItem to append to act as the padding
> and just keep it at the end of the tree.
> 
> I'll continue to investigate.

I'm currently working on bug 470031 full time so I am tossing this bug back into the pool.

Current workaround: disable overlay scrolling fixes the issue. This can be accomplished by setting the GTK_OVERLAY_SCROLLING environment variable to 0. 

I.e.:

export GTK_OVERLAY_SCROLLING=0
./eclipse
Comment 10 Stephan Herrmann CLA 2017-11-20 16:08:51 EST
(In reply to Eric Williams from comment #9)
> Current workaround: disable overlay scrolling fixes the issue. This can be
> accomplished by setting the GTK_OVERLAY_SCROLLING environment variable to 0. 
> 
> I.e.:
> 
> export GTK_OVERLAY_SCROLLING=0
> ./eclipse

I can confirm that this is an effective workaround.

I'm not even sure that overlay scrollbars improve anything for me ;p
so I might actually keep that setting ...
Comment 11 Eric Williams CLA 2018-03-23 09:53:39 EDT
*** Bug 496828 has been marked as a duplicate of this bug. ***
Comment 12 Eric Williams CLA 2018-05-15 15:58:17 EDT
*** Bug 479226 has been marked as a duplicate of this bug. ***
Comment 13 Dani Megert CLA 2019-01-31 05:18:12 EST
*** Bug 543990 has been marked as a duplicate of this bug. ***
Comment 14 Stephan Herrmann CLA 2019-01-31 08:21:48 EST
If no fix is scheduled, I suggest to prominently recommend
   export GTK_OVERLAY_SCROLLING=0
in toplevel download / installation documentation.

While looking for the proper location I wonder which is more suitable:

https://www.eclipse.org/eclipse/development/readme_eclipse_4.10.php
 - not visible from https://www.eclipse.org/downloads/

https://wiki.eclipse.org/Eclipse/Installation
 - has no section for platform specific issues
Comment 15 Eric Williams CLA 2019-03-29 08:12:02 EDT
(In reply to Stephan Herrmann from comment #14)
> If no fix is scheduled, I suggest to prominently recommend
>    export GTK_OVERLAY_SCROLLING=0
> in toplevel download / installation documentation.
> 
> While looking for the proper location I wonder which is more suitable:
> 
> https://www.eclipse.org/eclipse/development/readme_eclipse_4.10.php
>  - not visible from https://www.eclipse.org/downloads/
> 
> https://wiki.eclipse.org/Eclipse/Installation
>  - has no section for platform specific issues

I think I'll create a "known issues" section in the SWT wiki which I can point users to for cases like this.
Comment 16 Stephan Herrmann CLA 2019-03-29 19:21:31 EDT
(In reply to Eric Williams from comment #15)
> (In reply to Stephan Herrmann from comment #14)
> > If no fix is scheduled, I suggest to prominently recommend
> >    export GTK_OVERLAY_SCROLLING=0
> > in toplevel download / installation documentation.
> > 
> > While looking for the proper location I wonder which is more suitable:
> > 
> > https://www.eclipse.org/eclipse/development/readme_eclipse_4.10.php
> >  - not visible from https://www.eclipse.org/downloads/
> > 
> > https://wiki.eclipse.org/Eclipse/Installation
> >  - has no section for platform specific issues
> 
> I think I'll create a "known issues" section in the SWT wiki which I can
> point users to for cases like this.

To have it in the wiki is a good start, but my idea was to pro-actively recommend this, rather than waiting for users to become frustrated.
Comment 17 Stephan Herrmann CLA 2019-09-24 09:45:10 EDT
*** Bug 551411 has been marked as a duplicate of this bug. ***
Comment 18 Stephan Herrmann CLA 2019-09-24 17:23:47 EDT
Actually, since recently (?) my workaround by disabling overlay scrolling no longer works: even a fixed / static horizontal can hide relevant content!! 

This, however, happens only sometimes, seen specifically, in the Git Staging view, and a little while later I could not reproduce. But I remember having seen this effect several times lately.
Comment 19 Taro Kyo CLA 2019-11-21 16:33:07 EST
I actually prefer the proposed solution to add a blank TreeItem to append to as padding.

The issue with GTK_OVERLAY_SCROLLING=0 is that:

- Users may not know where to set this environment variable to.
- Users may accidentally tweak and break their own custom GTK themes styles.
- Users may accidentally disable the overlay scrolling across multiple user accounts, given that the online resources are not strongly recommending to only add this to Eclipse itself, but rather recommending it to be added as part of the profiles.
- This flag may be subjected to changes in the Ubuntu upstream, particularly if Gnome4 will change the scrollbar behaviors again in some future.
Comment 20 Eric Williams CLA 2019-11-21 17:10:08 EST
There is an option to add some margin to the bottom of the StyledText/Tree in order to prevent this from happening. I'll look into it for 4.15 -- GNOME builder does it this way so we might be able to as well.
Comment 21 Eric Williams CLA 2019-12-16 14:36:12 EST
I didn't manage to get to this -- FWIW I think the margin solution is the way to go. I tried it once in GtkInspector and it fixed the issue, we just need to style the extra part (the margin) but I think that can also be done with some GTK CSS.
Comment 22 Luis Muñoz CLA 2020-01-09 15:31:56 EST
I can confirm the mentioned workaround works on a per application bases

OS              : OpenSuse 15.1
eclipse.buildId : 4.13.0.I20190916-1045
gtk3 version    : 3.22.30

Workaround:

Launch eclipse as

GTK_OVERLAY_SCROLLING=0 <path to eclipse>/eclipse
Comment 23 Luis Muñoz CLA 2020-01-09 15:36:38 EST
Credit for comment 22.
Workaround taken from
http://ubuntuhandbook.org/index.php/2019/09/make-scrollbar-always-visible-ubuntu-18-04/
Comment 24 Soraphol (Paul) Damrongpiriyapong CLA 2020-06-03 15:50:08 EDT
Created attachment 283136 [details]
Bottom margin on treeview

Looking to pick up where this was left off. I have been trying to file alternatives to adding a margin to all Scrollable components. I have tried overwritting the page size so the vertical scroll is larger by a bit, but wasn't successful. 

I added a screenshot of what the margin would look. The problem with this is that it doesn't look very nice.
Comment 25 Taro Kyo CLA 2020-10-07 10:46:31 EDT
To comment #24

What if you just add an extra child element to the Scrollable component, instead of margins? This extra child element can be disabled, so no clickable events will occur.