Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diff window scroll bug #6995

Closed
trixon opened this issue Jan 25, 2024 · 2 comments
Closed

Diff window scroll bug #6995

trixon opened this issue Jan 25, 2024 · 2 comments
Labels
kind:bug Bug report or fix UI User Interface
Milestone

Comments

@trixon
Copy link
Contributor

trixon commented Jan 25, 2024

Apache NetBeans version

Apache NetBeans 20

What happened

When I place the mouse on any of the line number columns in the Diff window and swipe two fingers up/down to scroll the lines, only the line number part scrolls, not the lines themselves.

I can reproduce this with NB20 & NB21-rc1 on different linux systems with X and Wayland,
on windows it works as expected.

Screenshot with scrolled numbers in a file without major changes..

bild

Language / Project Type / NetBeans Component

No response

How to reproduce

Place the mouse on any of the line number columns in the Diff window and swipe two fingers up/down to scroll the lines.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Linux

JDK

21.0.1; OpenJDK 64-Bit Server VM 21.0.1+12-LTS; Azul Systems, Inc.

Apache NetBeans packaging

Apache NetBeans Snap Package

Anything else

No response

Are you willing to submit a pull request?

No

@trixon trixon added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Jan 25, 2024
@neilcsmith-net neilcsmith-net added os:linux and removed needs:triage Requires attention from one of the committers labels Jan 25, 2024
@mbien
Copy link
Member

mbien commented Jan 27, 2024

also reproducible on windows.

JDKs:

  • 11, 17, 18 -> good
  • 19+ -> bad

@mbien mbien added UI User Interface and removed os:linux labels Jan 27, 2024
@mbien mbien changed the title Diff window scroll bug on linux Diff window scroll bug Jan 27, 2024
@mbien
Copy link
Member

mbien commented Jan 27, 2024

so, this might be a jdk bug.

diff --git a/ide/diff/src/org/netbeans/modules/diff/builtin/visualizer/editable/DiffContentPanel.java b/ide/diff/src/org/netbeans/modules/diff/builtin/visualizer/editable/DiffContentPanel.java
index d693f77..4b78741 100644
--- a/ide/diff/src/org/netbeans/modules/diff/builtin/visualizer/editable/DiffContentPanel.java
+++ b/ide/diff/src/org/netbeans/modules/diff/builtin/visualizer/editable/DiffContentPanel.java
@@ -67,7 +67,7 @@
         add(scrollPane);
         
         linesActions = new LineNumbersActionsBar(this, master.isActionsEnabled());
+        linesActions.addMouseWheelListener(e -> {});
 
         actionsScrollPane = new JScrollPane(linesActions);
         actionsScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);

this did already stop the line numbers component from scrolling - which is unusual. I originally planned on adding e.consume() as quick fix, but the empty listener was enough.

please take a look at the dev build of #7009, it delegates the mouse events to the editor.

https://github.com/apache/netbeans/actions/runs/7681017023/artifacts/1199941257

@neilcsmith-net neilcsmith-net added this to the NB21 milestone Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix UI User Interface
Projects
None yet
Development

No branches or pull requests

3 participants