Bug 205137 - [win32] Scrollable does not support scrolling with horizontal mouse wheel
Summary: [win32] Scrollable does not support scrolling with horizontal mouse wheel
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows All
: P3 normal with 2 votes (vote)
Target Milestone: 4.19 M3   Edit
Assignee: Nikita Nemkin CLA
QA Contact: Niraj Modi CLA
URL:
Whiteboard:
Keywords: noteworthy
: 217564 298978 444851 517311 (view as bug list)
Depends on:
Blocks: 571464 569282
  Show dependency tree
 
Reported: 2007-10-01 20:54 EDT by atomi CLA
Modified: 2021-04-16 14:50 EDT (History)
15 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description atomi CLA 2007-10-01 20:54:13 EDT
Build ID: I20070921-0919

Steps To Reproduce:
1. scroll wheel is navigated left or right in editor
2. the editor does not navigate left or right as expected.

More information:
SWT. Horizontal scroll wheel navigation is very useful when browsing in firefox; I catch myself trying to use it when coding in eclipse for long lines instead. How about we add this for those of us that hate word wrapping. I know not everyone has a horizontal scroll wheel but I'm guessing it should be trivial to add and the benefits would be worthwhile.
Comment 1 Felipe Heidrich CLA 2007-11-13 15:25:51 EST
It works for me in the JavaEditor
on windows xp with logitech mx evolution
on windows vista with ms natural wireless laser mouse 6000

can you please try this again ?
Comment 2 atomi CLA 2007-12-14 23:34:08 EST
I'm still not able to scroll horizontally (on Vista w/ Logitech G5).
Comment 3 atomi CLA 2007-12-19 20:02:51 EST
The editor view will still not scroll horizontally with the mouse wheel. However this functionality is available with most views. I'm guessing allowing horizontal scrolling in views but not in the editor is done for a specific reason. Or was this just overlooked?
Comment 4 Felipe Heidrich CLA 2008-02-26 11:59:21 EST
*** Bug 217564 has been marked as a duplicate of this bug. ***
Comment 5 Felipe Heidrich CLA 2008-03-11 17:06:54 EDT
>I'm guessing allowing horizontal scrolling in views but not in the editor is
>done for a specific reason. 
It should work for you. It works for me, I tried different mouses. 
I don't know know to procede here. Would you by change have another mouse with a h-wheel that you could test with ?


Comment 6 atomi CLA 2008-03-11 19:14:05 EDT
(In reply to comment #5)
> >I'm guessing allowing horizontal scrolling in views but not in the editor is
> >done for a specific reason. 
> It should work for you. It works for me, I tried different mouses. 
> I don't know know to procede here. Would you by change have another mouse with
> a h-wheel that you could test with ?
> 

I don't. But it's certainly not the mouse I'm using. The horizontal scrolling works just fine in the views as mentioned (and other apps like firefox), just not in the eclipse editor.
Comment 7 Felipe Heidrich CLA 2008-07-24 14:15:35 EDT
What is your mouse (hardware and driver) ?
Comment 8 atomi CLA 2008-07-31 11:57:07 EDT
The mouse is a Logitech G5 using the default Vista drivers (mouclass.sys & mouhid.sys).
Comment 9 Eclipse Webmaster CLA 2019-09-06 16:11:53 EDT Comment hidden (obsolete)
Comment 10 Rolf Theunissen CLA 2020-05-01 16:02:45 EDT
Scrollable on win32 does not implement WM_MOUSEHWHEEL, it does implement WM_MOUSEWHEEL. 

As a result, only widgets that support native scrolling support scrolling by horizontal mouse wheel. For instance, a tree (without columns See Bug 562499) does support scrolling by horizontal mouse wheel.
Comment 11 Rolf Theunissen CLA 2020-05-01 16:13:49 EDT
*** Bug 298978 has been marked as a duplicate of this bug. ***
Comment 12 Rolf Theunissen CLA 2020-05-01 16:14:15 EDT
*** Bug 444851 has been marked as a duplicate of this bug. ***
Comment 13 Rolf Theunissen CLA 2020-05-01 16:21:27 EDT
*** Bug 517311 has been marked as a duplicate of this bug. ***
Comment 14 Peter Bowers CLA 2021-01-30 06:51:09 EST
I can confirm that this is still an issue, apparently after roughly 14 years.

Today not many people are going to be using mouse wheels, but lots and lots of people are going to be using 2-finger scrolling on their trackpad and while this works fine vertically it does NOT work horizontally in the eclipse code editor.
Comment 15 Wim Jongman CLA 2021-01-30 10:26:32 EST
Adding Laurent. Laurent, IIRC, you made something like this?
Comment 16 Laurent CARON CLA 2021-02-01 09:08:24 EST
Hi Wim

I've added a "Mouse Navigator" (https://bugs.eclipse.org/bugs/show_bug.cgi?id=542777) that mimics the behaviour of Firefox or Chrome when you click on the wheel button. 

It does not concern the "horizontal" mouse wheel button
Comment 17 Eclipse Genie CLA 2021-02-15 07:27:00 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/176263
Comment 19 Niraj Modi CLA 2021-02-15 12:00:50 EST
(In reply to Eclipse Genie from comment #18)
> Gerrit change
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/176263 was
> merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=129a23713801a007bc805104cc17ed8a0784d713

Thanks Nikita for the fix, resolving for 4.19 M3.
Comment 20 Wim Jongman CLA 2021-02-15 12:10:19 EST
(In reply to Niraj Modi from comment #19)
> (In reply to Eclipse Genie from comment #18)
> > Gerrit change
> > https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/176263 was
> > merged to [master].
> > Commit:
> > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> > ?id=129a23713801a007bc805104cc17ed8a0784d713
> 
> Thanks Nikita for the fix, resolving for 4.19 M3.

Thanks, Nikita!! Well done. The person fixing the oldest bug in a milestone gets free cake from the project lead :)
Comment 21 Lars Vogel CLA 2021-02-16 03:24:05 EST
Thanks Nikita, can you add this to the N&N?
Comment 22 Eclipse Genie CLA 2021-02-16 03:44:54 EST
New Gerrit change created: https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/176313
Comment 24 Niraj Modi CLA 2021-02-17 05:56:52 EST
Reopening, Horizontal scroll works but the direction seems to be opposite as compared to other applications.

Will fix shortly.
Comment 25 Eclipse Genie CLA 2021-02-17 05:58:36 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/176387
Comment 27 Niraj Modi CLA 2021-02-17 06:02:26 EST
(In reply to Eclipse Genie from comment #26)
> Gerrit change
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/176387 was
> merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=af4be3eb04934002f29e7e40fb7e9f9dd42710d5

Resolving now, will verify in the next IBuild.
Comment 28 Nikita Nemkin CLA 2021-02-17 06:24:25 EST
(In reply to Niraj Modi from comment #27)
> (In reply to Eclipse Genie from comment #26)
> > Gerrit change
> > https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/176387 was
> > merged to [master].
> > Commit:
> > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> > ?id=af4be3eb04934002f29e7e40fb7e9f9dd42710d5
> 
> Resolving now, will verify in the next IBuild.

Niraj, -1*wParam is not a good fix, it messes up control button flags. I'm working on a better fix.
Comment 29 Eclipse Genie CLA 2021-02-17 09:10:40 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/176412
Comment 30 Nikita Nemkin CLA 2021-02-17 09:13:42 EST
I've posted an improved patch. It fixes some logical errors, better replicates modern browser scrolling behavior and reverts some unnecessary changes from Bug 565426 (preserving the behavior).
Comment 31 Niraj Modi CLA 2021-02-18 05:09:17 EST
(In reply to Nikita Nemkin from comment #30)
> I've posted an improved patch. It fixes some logical errors, better
> replicates modern browser scrolling behavior and reverts some unnecessary
> changes from Bug 565426 (preserving the behavior).

Sure, lets finalize on this by 4.19 RC1
Comment 32 Alexandr Miloslavskiy CLA 2021-02-18 15:47:59 EST
The last patch caused me to be pretty confused about what to do next.

I spent reasonable time to get through old code and understand what does it do, then laid it in easier to read code, also removing duplication.

Nikita now reverted my work without need. Here, by need I understand that it wasn't blocking his work. Nikita explained, quote, "I had to understand the code to add horizontal scrolling and it was easier to understand without the unnecessary factoring that you did".

Reverting my work is clearly a destructive act (because my work is destroyed), and I would also call it aggressive. I understand that either this action needs to be balanced by good reasons, or it's simply evil.

Now, the reason given is that old code was more readable. I understand that when saying "more readable", there's a lot of different things that people tend to mix together here:

1) Readable, as in "proof-read". That is, for some code, does it take less time to achieve very good confidence that said code is correct and does not have bugs?

2) Readable, as in "easy to parse". Surprisingly, this is sometimes opposite to (1), for example code like "if ((1 < x) && (x < 5))" is less intuitive to read, but is more robust and easier to proof-read once you get the idea of "x is written between 1 and 5".

3) Readable, as in "easy to hack". That is, one can quickly spot a location for a quick hack without paying attention to anything else. One example here is copy&pasting all code always. This way, it's easy to hack one copy without worrying about another.

4) Readable, as in "I can see it on same screen". This is often seen as opposite to formatting code with empty lines, comments, etc. This is usually opposite to (1)(2).

5) Readable, as in "I'm used to that". Some people are used to "if (1 == x)", others to "if (x == 1)", and each would call the other variant less readable.

6) Readable, as in "read aloud". That is, reading mechanically, without trying to understand code. For example, having shorter variable names and less code overall, so that one can literally read it aloud in shorter time.

----

It's easy to see that there is a number of contradicting definitions of what is readable. One programmer could argue that X is more readable under one definition, whereas the other will argue that Y is more readable under the other definition.

I believe that this is the most helpful definition of "readable" is (1), the "proof-read" definition. If under any other definition code Y is "more readable" but is harder to proof-read, then it's more likely to have bugs, and bugs tend to beat any other benefit.

Now, Nikita, under which definition you liked the old code better? Was it important enough to justify destroying work of other team member?
Comment 33 Nikita Nemkin CLA 2021-02-19 04:16:18 EST
(In reply to Alexandr Miloslavskiy from comment #32)
> The last patch caused me to be pretty confused about what to do next.
> 
> I spent reasonable time to get through old code and understand what does it
> do, then laid it in easier to read code, also removing duplication.
> 
> Nikita now reverted my work without need. Here, by need I understand that it
> wasn't blocking his work. Nikita explained, quote, "I had to understand the
> code to add horizontal scrolling and it was easier to understand without the
> unnecessary factoring that you did".
> 
> Reverting my work is clearly a destructive act (because my work is
> destroyed), and I would also call it aggressive. I understand that either
> this action needs to be balanced by good reasons, or it's simply evil.
Your refactored something that didn't need refactoring, which made fixing this issue harder. So I based the fix on the previous, original version of the code. (I did incorporate good changes from your patch).

Claiming that I'm evil is next level bullshit.

When you merged some really terrible code, I kept silent, because it fixed bugs. I suggest you do the same.

> Now, Nikita, under which definition you liked the old code better? Was it
> important enough to justify destroying work of other team member?
I _restored_ the work of original SWT team members, for which you seem to have no respect whatsoever.
Comment 34 Lars Vogel CLA 2021-02-19 04:21:31 EST
Everybody, please remain friendly and respectful. We are all in the same boat and are trying to improve SWT and Eclipse.

If concerns with code exists they should be raised via code review. And if committers have different styles of readability in code they can ask other activate SWT committers to give an opinion or the project lead for SWT.
Comment 35 Thomas Singer CLA 2021-02-23 09:10:51 EST
I need to say that I like Alexander's clear code. What is the code that was reverted? Where can I find it?

Nikita, are you sure about keeping the fixes from Bug 565426 - AKA were you able to reproduce the old buggy behavior and can confirm it remains solved with your recent changes?

I came here because the 

  -1 * wParam

change jumped to my eyes when looking at the recent master commits. Wouldn't

  -wParam

be more readable? Would a comment for this minus make it more understandable for the reader?
Comment 36 Niraj Modi CLA 2021-02-24 07:43:41 EST
(In reply to Lars Vogel from comment #34)
> Everybody, please remain friendly and respectful. We are all in the same
> boat and are trying to improve SWT and Eclipse.
> 
> If concerns with code exists they should be raised via code review. And if
> committers have different styles of readability in code they can ask other
> activate SWT committers to give an opinion or the project lead for SWT.

Some general guidelines from Eclipse/SWT perspective:
1. Just to re-iterate on above: Even for any dis-agreements lets remain on the technical side only.
2. Gerrit reviews are there to discuss merits and demerits of the code.
3. Bugzilla is anyways there for requirement analysis, evaluating possible design-approaches, use-cases related and other discussions in general.

Please be respectful for other committers and create a win-win situation for all.
Thanks!
Comment 37 Niraj Modi CLA 2021-02-24 07:52:06 EST
(In reply to Eclipse Genie from comment #29)
> New Gerrit change created:
> https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/176412

Above patch is still under review/discussion, hence closing current bug for 4.19.
Raised bug 571464 for further improvements which are under discussion in 4.20
Comment 38 Lars Vogel CLA 2021-04-15 04:46:02 EDT
Would be nice to have the same horizontal scroll support for Table. Do we already have a bug for this?
Comment 39 Rolf Theunissen CLA 2021-04-16 14:50:27 EDT
(In reply to Lars Vogel from comment #38)
> Would be nice to have the same horizontal scroll support for Table. Do we
> already have a bug for this?

For Tree with columns there is Bug 562499, I don't recall that there is bug for Table.