Bug 467329 - Editor window scrolls one line at a time
Summary: Editor window scrolls one line at a time
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.4.2   Edit
Hardware: PC Windows 7
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2015-05-14 09:04 EDT by David Karnok CLA
Modified: 2021-07-04 02:57 EDT (History)
5 users (show)

See Also:


Attachments
animated png of the problem (1.07 MB, image/apng)
2018-08-02 10:56 EDT, Manuel Hegner CLA
no flags Details
animated pic to showcase the problem (3.88 MB, image/apng)
2019-11-16 22:25 EST, raner bingmeiyou CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Karnok CLA 2015-05-14 09:04:17 EDT
Sometimes, when a Java file is open in the editor and I want to scroll the test with my mouse, the editor window starts to scroll one line at a time instread of the usual 3 lines. 

This doesn't affect all open editor tabs: some tabs scroll just fine while others get stuck in this one-line scroll mode until I close and re-open that tab. 

I've noticed this behavior of Eclipse since at least from v4.2. The length of the file open (or the current Java compliance level) doesn't seem to play any role and I run into this in a vanilla Eclipse for Java Developers as well.
Comment 1 Dani Megert CLA 2015-05-14 09:39:36 EDT
There is very low chance that we can do something here without more details. We've never heard of this so far, IIRC.
Comment 2 David Karnok CLA 2015-05-15 08:41:59 EDT
Hope the report finds the proper people.

I almost forgot that I have changed the default editor font to Consolas 17pt. If I change it around, the problem disappears for a bit, then comes back again. The change fixes previously 'broken' tabs, but not for good.
Comment 3 Niraj Modi CLA 2015-05-18 09:06:56 EDT
(In reply to David Karnok from comment #2)
> Hope the report finds the proper people.
> 
> I almost forgot that I have changed the default editor font to Consolas
> 17pt. If I change it around, the problem disappears for a bit, then comes
> back again. The change fixes previously 'broken' tabs, but not for good.

Tried with 4.4.2 and latest 4.5 Eclipse builds with "Consolas 17pt" font on Win7, Java editor continues to scrolls 3 lines with mouse.

Did you observed this issue on any other machine/platforms ?
Let us know, if you have more specific information to reproduce this issue at our end.
Comment 4 David Karnok CLA 2015-05-18 09:55:12 EDT
Over a year, I've experienced this issue on 4 different computers: a Core 2 Duo E6600 + Windows 7 x86, i7 920, i7 4770 and i7 4790; these latter with Windows 7 x64. Java versions ranged from 1.7u25 up to the most recent 1.8u45. Happened on both 32 bit and 64 bit Eclipse over the period. I haven't tried on other platforms.

I've recorded the bug: https://youtu.be/xV4BMNKt8ys so you can see something is not working properly.

It is possible there the contents of the file has something to do with it. The problematic panel uses lambdas and has some folded lines.

My guess would be that there is something wrong between org.eclipse.swt.widgets.Scrollable.wmScrollWheel and StyledTextRenderer.getTextLayout. Perhaps the TextLayout references the wrong font and size when the line height is calculated in TextLayout.getLineMetrics: 

OS.SelectObject(srcHdc, font != null ? font.handle : device.systemFont.handle);
Comment 5 David Karnok CLA 2015-05-26 09:12:52 EDT
I have the same issue with Eclipse 4.5 RC 1 64bit.
Comment 6 David Karnok CLA 2015-07-24 03:44:37 EDT
The issue is still there with 4.5 final, clean install, new workspace and new project.
Comment 7 David Karnok CLA 2015-08-03 08:49:59 EDT
I did some measuring with the broken scrolling panel. With Consolas 17pt Central European settings, line distance is 27 pixels and the mouse scroll moves 30 pixels up or down. As if there were a default 10 pixel row height which is multiplied by 3. I'd think when the editor is loaded, it doesn't pick up the font size properly and uses some default value.
Comment 8 David Karnok CLA 2016-07-22 04:11:29 EDT
I'm still having this issue in 4.6 (20160613-1800). What additional information should I provide?
Comment 9 Manuel Hegner CLA 2018-08-02 10:55:13 EDT
I have the same problem (as described sometimes) with eclipse 4.8.0 on Windows 10.
I use the high dpi mode of windows, but no compatibility settings for eclipse. The Editor font is set to Consolas Regular 14. I have to problem on multiple computers (with similar configurations)

After some tests I think I have found the pattern. Whenever I open a java file with no editor tabs open everything works fine. If I open a second or more java files the are only scrolling one line at a time. The tabs are then bugged whatevery I do. But the bug only occurs for the second (and third and so one) tab I open. If I change the order with the same Java files it is still the second tab that is broken.

I created an animated gif to showcase the problem (see animated.png).
Comment 10 Manuel Hegner CLA 2018-08-02 10:56:30 EDT
Created attachment 275237 [details]
animated png of the problem
Comment 11 raner bingmeiyou CLA 2018-12-15 23:56:07 EST
I have the same issue with both eclipse-cpp-oxygen-3a-win32-x86_64 and eclipse-cpp-2018-09-win32-x86_64 on Windows 10 (high dpi 150%).
The C/C++ editor text font used by C/C++ editors is Consolas 10.
Comment 12 raner bingmeiyou CLA 2019-11-16 22:23:20 EST
Issue still exist with eclipse 2019-R on both Windows 10(HiDPI) and Windows 7(NO HiDPI).
I created an animated pic to showcase the problem.
Take with eclipse 2019-R on Windows 10.
NO custom config, just unzip eclipse-cpp-2019-09-R-win32-x86_64.zip and import an exist c project to a new workspace.
see eclipse-bug-scroll.apng
Comment 13 raner bingmeiyou CLA 2019-11-16 22:25:15 EST
Created attachment 280667 [details]
animated pic to showcase the problem

NO custom config, just unzip eclipse-cpp-2019-09-R-win32-x86_64.zip and import an exist c project to a new workspace.
Comment 14 Cédric Catoliquot CLA 2021-07-04 01:46:36 EDT
Issue since 2015 in NEW. Yeah ! Remind me the project I am working on at work. :-)

I just got the problem here in a PHP project.
Mouse scroll was 2 lines, without any reason.
I changed the font to Consolas 12.
Scroll again, 3 lines.
I change back the font to default Consolas 10 and the scroll is still at 3 lines per click...

Don't really understand how it works, but for me changing the font solved the issue.
Comment 15 David Karnok CLA 2021-07-04 02:57:44 EDT
(In reply to Cédric Catoliquot from comment #14)
> Don't really understand how it works, but for me changing the font solved
> the issue.

Yes that works for a bit but then newer code tabs break again. I'd have to do the font shuffling over and over.

Btw, mid 2021 here and Eclipse 4.20 still does this.