From 22cd8968cb507d29fc31303f2f5fe8015db7943a Mon Sep 17 00:00:00 2001 From: Denny Sheirer Date: Sun, 8 Nov 2026 05:44:53 -0500 Subject: [PATCH] #1248 Frequency control doesn't allow mouse wheel to change value when locked (#2603) Co-authored-by: denny --- .../dsheirer/gui/control/JFrequencyControl.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/dsheirer/gui/control/JFrequencyControl.java b/src/main/java/io/github/dsheirer/gui/control/JFrequencyControl.java index 4e0d79cd..3f042b82 100644 --- a/src/main/java/io/github/dsheirer/gui/control/JFrequencyControl.java +++ b/src/main/java/io/github/dsheirer/gui/control/JFrequencyControl.java @@ -45,6 +45,7 @@ import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; +import javax.swing.SwingUtilities; import javax.swing.UIManager; /** @@ -575,7 +576,17 @@ public class JFrequencyControl extends JPanel implements ISourceEventProcessor @Override public void mouseWheelMoved(MouseWheelEvent e) { - set(mValue - e.getWheelRotation()); + //Swing delivers mouse wheel events to disabled components, so check enabled state explicitly so that + //the wheel can't bypass the lock when the tuner is providing channels. + if(isEnabled()) + { + set(mValue - e.getWheelRotation()); + } + else if(getParent() != null) + { + //Pass the event up so that an enclosing scroll pane can still scroll while this control is locked + getParent().dispatchEvent(SwingUtilities.convertMouseEvent(Digit.this, e, getParent())); + } } } }