Bug 506767 - Dark theme disables side scrolling in code editor
Summary: Dark theme disables side scrolling in code editor
Status: CLOSED DUPLICATE of bug 562112
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2016-10-31 00:08 EDT by Nobody - feel free to take it CLA
Modified: 2020-04-14 10:58 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nobody - feel free to take it CLA 2016-10-31 00:08:59 EDT
In every theme besides the dark theme, I can side scroll using my Surface Pro 4's trackpad anywhere in the code editor, regardless of whether my cursor is hovering over code or over the side scrollbar.
I can side scroll in bug/task submission, the package explorer, git, etc. only if I hover the cursor over the side scroll bar, then swipe left/right with 2 fingers.
If I enable the dark theme, I cannot side scroll at all in the code editor, even if my cursor is hovering over the side scrolling bar.
Restarting between theme switches does not fix this.
The dark theme is the only theme that causes problems. All the other stock themes (Classic, Windows, Windows XP Blue, Windows XP Olive, and Windows Classic) all work just fine with side-scrolling.
I had chalked it up to just being a faulty install until I changed the theme just to see what the XP Olive theme looked like and accidentally side scrolled.
I believe the cause of this is the custom auto-hiding scroll bars that the dark theme uses, since that is the only thing that is different besides the coloring in all the other themes.


-- Configuration Details --
Product: Eclipse 4.6.0.20160613-1800 (org.eclipse.epp.package.java.product)
Installed Features:
 org.eclipse.platform 4.6.0.v20160606-1342
Comment 1 Patrik Suzzi CLA 2016-10-31 04:19:59 EDT
I can reproduce in Eclipse SDK
Version: Oxygen (4.7)
Build id: I20161027-0700
OS: Windows 10, v.10.0, x86_64 / win32

In my case, I can see the difference in side scroll for editors, but not in package explorer. Side scroll in package explorer is disabled, no matter which theme I'm using
Comment 2 Lars Vogel CLA 2016-10-31 05:02:41 EDT
The StyledText widget uses non native scrollbars, I assume the integration in Surface Pro is for the native scrollbars.

@Fabio, any idea how this can be solved?

@David, as workaround you can turn the non-native scrollbars off, see https://www.eclipse.org/eclipse/news/4.6/M7/#dark-theme-styled-text-scrollbar
Comment 3 Fabio Zadrozny CLA 2016-10-31 05:59:18 EDT
I *think* that it should be possible to fix this based on the gestures API (https://bugs.eclipse.org/bugs/show_bug.cgi?id=279884) and handling those events (right now the scroll replacement only deals with mouse/keyboard events).

The major issue for me is that I don't have a hardware with side scrolling for checking/solving that... (i.e.: for me, scrolling swiping with 2 fingers up/down in the mousepad does work -- so, my drivers must be doing something different -- and I don't really have a touch enabled hardware where I can reproduce the issue).

For someone interested in solving it, the place where the fix should happen is:

org.eclipse.e4.ui.internal.css.swt.dom.scrollbar.AbstractThemedScrollBarAdapter.handleEvent(Event) -- that's where all the events related to the themed scrollbar are treated.

The workaround for now is disabling the themed scrollbar, as Lars pointed out.
Comment 4 Patrik Suzzi CLA 2016-10-31 10:04:05 EDT
(In reply to Fabio Zadrozny from comment #3)
> The major issue for me is that I don't have a hardware with side scrolling
> for checking/solving that... (i.e.: for me, scrolling swiping with 2 fingers
> up/down in the mousepad does work -- so, my drivers must be doing something
> different -- and I don't really have a touch enabled hardware where I can
> reproduce the issue).

Side scroll issue: reproducible when scrolling with two fingers left and right.

I can reproduce and help with testing.
Comment 5 Patrik Suzzi CLA 2016-11-01 05:36:05 EDT
Actually, I verified that AbstractThemedScrollBarAdapter#handleEvent() is not called when you scroll the mouse either vertically or horizontally.
Comment 6 Patrik Suzzi CLA 2016-11-01 05:41:05 EDT
Can you tell which method handles the horizontal/vertical scrolling, and/or if there is some filter that is added that might prevent the scrolling action?

Thanks and regards.
Comment 7 Fabio Zadrozny CLA 2016-11-01 05:42:16 EDT
(In reply to Patrik Suzzi from comment #5)
> Actually, I verified that AbstractThemedScrollBarAdapter#handleEvent() is
> not called when you scroll the mouse either vertically or horizontally.

I think that in org.eclipse.e4.ui.internal.css.swt.dom.scrollbar.AbstractThemedScrollBarAdapter.install(), you probably need to add the filter for SWT.Gesture or SWT.Touch to listen those events.
Comment 8 Fabio Zadrozny CLA 2016-11-01 06:39:37 EDT
(In reply to Patrik Suzzi from comment #6)
> Can you tell which method handles the horizontal/vertical scrolling, and/or
> if there is some filter that is added that might prevent the scrolling
> action?
> 
> Thanks and regards.

Related to the filter see #Comment 7

For actually doing the scroll, it'd be something as:

fScrollBar.setSelection(scrollPos);
notifyScrollbarSelectionChanged(scrollable, SWT.NONE);

as in:

org.eclipse.e4.ui.internal.css.swt.dom.scrollbar.AbstractScrollHandler.scrollOnMouseDown(Scrollable, Point, Rectangle)

which is called in:

org.eclipse.e4.ui.internal.css.swt.dom.scrollbar.AbstractThemedScrollBarAdapter.handleEvent(Event)

for fHorizontalScrollHandler and fVerticalScrollHandler.
Comment 9 Patrik Suzzi CLA 2016-12-19 20:26:57 EST
This bug needs some love: HelpWanted!
Comment 10 Eclipse Genie CLA 2020-02-10 13:12:04 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 11 Lars Vogel CLA 2020-04-14 10:58:13 EDT
Should be fixed with Bug 562112

*** This bug has been marked as a duplicate of bug 562112 ***