Bug 558496 - [gtk] [regression] Tree.showItem() scrolls even if the item is visible
Summary: [gtk] [regression] Tree.showItem() scrolls even if the item is visible
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.14   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.16 M1   Edit
Assignee: Sravan Kumar Lakkimsetti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-20 03:28 EST by Knut Wannheden CLA
Modified: 2020-04-08 02:37 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Knut Wannheden CLA 2019-12-20 03:28:50 EST
Since updating to Eclipse 4.14 (and EGit 5.6.0) the Git Repositories view appears to have a new behavior in Linux (GTK), which can be somewhat annoying: When selecting an item in the Git Repositories tree view, the view automatically scrolls vertically so that the item is centered in the view. This makes it difficult to get double-click to work reliably.

I couldn't find a preference to disable this feature.
Comment 1 Thomas Wolf CLA 2019-12-20 09:38:24 EST
Indeed it does, but apparently only on GTK/Eclipse 4.14. Doesn't do so on Mac, and doesn't do so in GTK/Eclipse 4.13.

CentOS 7,
org.eclipse.swt.internal.deviceZoom=100
org.eclipse.swt.internal.gdk.backend=x11
org.eclipse.swt.internal.gtk.theme=Adwaita
org.eclipse.swt.internal.gtk.version=3.22.30
Comment 2 Knut Wannheden CLA 2019-12-20 10:28:23 EST
Note: I have not yet encountered any other tree widget in Eclipse 4.14 which exposes this behavior.
Comment 3 Thomas Wolf CLA 2019-12-20 10:59:52 EST
Perhaps a side-effect of the inline renaming of Repository Groups. The JFace inline editing support tracks the current focus cell, and calls ViewerCell.scrollIntoView(), which ends up calling Tree.showItem(). The javadoc says "If the item is already showing in the receiver, this method simply returns.  Otherwise, the items are scrolled and expanded until the item is visible." But since https://git.eclipse.org/r/#/c/151275/ that scrolls on GTK even if the item is visible!
Comment 4 Dani Megert CLA 2019-12-21 03:56:23 EST
It works for me on Windows 10, but I have a pretty old EGit version installed.

(In reply to Knut Wannheden from comment #2)
> Note: I have not yet encountered any other tree widget in Eclipse 4.14 which
> exposes this behavior.
Did you try in the Project Explorer? If it only happens in the Git Repositories view, then it might be an EGit issue.
Comment 5 Thomas Wolf CLA 2019-12-21 05:59:49 EST
(In reply to Dani Megert from comment #4)
> Did you try in the Project Explorer? If it only happens in the Git
> Repositories view, then it might be an EGit issue.

If you look at https://git.eclipse.org/r/#/c/151275/ it's quite obvious that this is a regression in the GTK version of SWT. You can see the same behavior (on GTK) in the tracing preferences page.

Using an Eclipse for Committers, 2029-12, for Linux:

1. Open the tracing preferences page
2. Enable tracing
3. Make the dialog large enough to show some 20 lines
3. Expand the "Platform Debug UI" node
4. Scroll to such that the node is on the top line
   (or just scroll to the bottom)
5. Click on the first child ("org.eclipse.debug.ui/debug")

Result: the viewer scrolls the selected node to the middle of the tree.
Comment 6 Eclipse Genie CLA 2019-12-21 08:59:08 EST
New Gerrit change created: https://git.eclipse.org/r/154943
Comment 7 Thomas Wolf CLA 2019-12-21 09:40:46 EST
(In reply to Eclipse Genie from comment #6)
> New Gerrit change created: https://git.eclipse.org/r/154943

@Knut: I've put in a work-around in EGit that avoids triggering this SWT regression. Temporary update site at https://ci.eclipse.org/egit/job/egit.gerrit/1065/artifact/org.eclipse.egit.repository/target/repository/ , please test.

The underlying SWT problem of course still exists.
Comment 8 Eclipse Genie CLA 2019-12-24 09:20:44 EST
Gerrit change https://git.eclipse.org/r/154943 was merged to [master].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=9072fa39911083d1507f44c1380dba66f0b5fbae
Comment 9 Eclipse Genie CLA 2019-12-24 09:23:58 EST
New Gerrit change created: https://git.eclipse.org/r/155016
Comment 10 Eclipse Genie CLA 2019-12-24 11:14:13 EST
Gerrit change https://git.eclipse.org/r/155016 was merged to [stable-5.6].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=b7c9cd5be3ceac2aad7908334e1fc7c328a34eb4
Comment 11 Eclipse Genie CLA 2020-04-06 09:36:36 EDT
New Gerrit change created: https://git.eclipse.org/r/160525
Comment 12 Sravan Kumar Lakkimsetti CLA 2020-04-06 09:39:14 EDT
(In reply to Eclipse Genie from comment #11)
> New Gerrit change created: https://git.eclipse.org/r/160525

I do feel the above will fix underlying SWT problem. 

The earlier code was to scroll to the center of the window. Now with the above patch we do a minimum scroll to make tree item visible. 

Still some more testing is required. So I am moving this to M3
Comment 14 Sravan Kumar Lakkimsetti CLA 2020-04-06 10:17:03 EDT
(In reply to Eclipse Genie from comment #13)
> Gerrit change https://git.eclipse.org/r/160525 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=afbe225fce16da1155c27098e8554a85fe59c15d

Merged to master
Comment 15 Sravan Kumar Lakkimsetti CLA 2020-04-08 02:37:13 EDT
Verified in 
Eclipse SDK
Version: 2020-06 (4.16)
Build id: I20200407-1800
OS: Linux, v.4.15.0-96-generic, x86_64 / gtk 3.22.30
Java version: 1.8.0_242