Procházet zdrojové kódy

Horizontal mouse wheel as in FL 2026 (issue #254, round 190ou)

A tilt wheel or a mouse's second wheel, checked in FL 2026 on Thief (round 190ou, raw/fl-*.png):
- Playlist and Piano roll: a notch moves the view 1.5 beats sideways whatever the zoom (measured at 15.5 and 384 px a
  bar); right = later. In all three layouts (the Playlist component is shared). LYNX scrolled 80 / 60 px a notch on
  Windows (five bars a notch in Thief's Playlist).
- Mixer: a notch scrolls the strips one insert.
- Browser: the list takes it as the vertical wheel (right = up); ui/TiltViewport.h for its lists.
- Channel rack: FL does nothing; LYNX keeps scrolling its step grid sideways as before (owner decision listed).
core/EditorGestures.h horizontalWheelNotch tells a notch (deltaX alone, not smooth) from a trackpad's swipe (smooth,
unchanged), from macOS's Shift+wheel (deltaX with Shift, unchanged) and from Windows' pieces of a notch (made smooth).

Linux: X11 sends the horizontal wheel as buttons 6 / 7, which JUCE dropped: it did nothing at all there. JUCE patch
"fix 190ou" (cmake/LynxPatchJuce.cmake, juce_XWindowSystem_linux.cpp) delivers them as deltaX = +/-50/256.

Tests: hwheel254_notches_of_the_horizontal_wheel_only (lynx_tests) and LYNX --hwheel254test report.txt (the
Playlist in the Pattern, Clip-launch and Simple layouts at two zooms, the Piano roll at two zooms, Shift+wheel and a
trackpad swipe as before, the Mixer, the Browser, and on X11 an end-to-end XTest press of buttons 7 and 6).
Ka1-S před 2 týdny
rodič
revize
4d4bc55477

+ 10 - 0
cmake/LynxPatchJuce.cmake

@@ -328,6 +328,12 @@
 #    when LYNX marked the editor "lynxScaleEditorDimensions" (FL's "Scale editor dimensions", or a DPI-unaware window):
 #    the size the plugin reports is then taken in logical pixels. An editor LYNX did not mark is sized as before.
 #
+# fix 190ou. Linux/BSD only ("fix 190ou" in round bugs_190ou's branch; the integration assigns its number),
+#    juce_gui_basics/native/juce_XWindowSystem_linux.cpp (issue #254): X11 reports a horizontal wheel (a tilt wheel, a
+#    mouse's second wheel, a touchpad's sideways edge) as buttons 6 (left) and 7 (right), which JUCE dropped: the
+#    horizontal wheel did nothing on Linux. They now come as a wheel event with deltaX = +/-50/256 (6 = left = positive,
+#    as Windows' WM_MOUSEHWHEEL gives it through JUCE) and deltaY 0, not smooth.
+#
 # Used by CMake (lynx_patch_juce on the fetched JUCE) and by scripts/build-windows-zig.sh, which runs this file with
 # `cmake -DJUCE_DIR=<a copy of JUCE's juce_gui_basics module> -P cmake/LynxPatchJuce.cmake`.
 
@@ -504,6 +510,10 @@ function(lynx_patch_juce_file file)
         lynx_juce_fix("frame moved, not restacked" "LYNX patch (issue #45): a frame that moved"
             "    if (configure.window != peerHandle && isParentWindowOf (configure.window, peerHandle))|NL|        dismissBlockingModals (peer);"
             "    // LYNX patch (issue #45): a frame that moved, not a restack|NL|    if (configure.window != peerHandle && isParentWindowOf (configure.window, peerHandle) && lynxWindowMovedOrResized (configure))|NL|        dismissBlockingModals (peer);")
+
+        lynx_juce_fix("horizontal wheel (buttons 6 / 7)" "LYNX patch (fix 190ou, issue #254)"
+            "    auto mapIndex = (uint32) (buttonPressEvent.button - Button1);|NL|"
+            "    // LYNX patch (fix 190ou, issue #254): buttons 6 / 7 are the horizontal wheel (a tilt wheel, a second wheel), left /|NL|    // right; JUCE dropped them. deltaX > 0 = left, as Windows' WM_MOUSEHWHEEL comes through JUCE|NL|    if (buttonPressEvent.button == 6 || buttonPressEvent.button == 7)|NL|    {|NL|        MouseWheelDetails wheel;|NL|        wheel.deltaX = buttonPressEvent.button == 6 ? 50.0f / 256.0f : -50.0f / 256.0f;|NL|        wheel.deltaY = 0.0f;|NL|        wheel.isReversed = false;|NL|        wheel.isSmooth = false;|NL|        wheel.isInertial = false;|NL||NL|        peer->handleMouseWheel (MouseInputSource::InputSourceType::mouse, getLogicalMousePos (buttonPressEvent, peer->getPlatformScaleFactor()),|NL|                                getEventTime (buttonPressEvent), wheel);|NL|        return;|NL|    }|NL||NL|    auto mapIndex = (uint32) (buttonPressEvent.button - Button1);|NL|")
     elseif(file MATCHES "juce_CoreGraphicsContext_mac.mm$")
         lynx_juce_fix("no gradient flood from an empty path" "LYNX patch (issue #11): an empty path"
             "        CGContextReplacePathWithStrokedPath (context.get());|NL||NL|    ScopedCGContextState scopedState (context.get());"

+ 275 - 0
src/HWheel254Test.inc

@@ -0,0 +1,275 @@
+    // LYNX --hwheel254test <report.txt> (round 190ou, issue #254): the horizontal wheel (a tilt wheel, a mouse's second
+    // wheel) through the real components, off screen, as JUCE delivers it (Windows' WM_MOUSEHWHEEL: deltaX = -/+60/256 a
+    // notch, right / left; X11's buttons 6 / 7 come the same way with the JUCE patch fix 190ou). FL 2026 (checked in this
+    // round on Thief): Playlist and Piano roll 1.5 beats a notch whatever the zoom, the Mixer one insert a notch, the
+    // Browser takes it as the vertical wheel (right = up). Shift+wheel, a trackpad's swipe and the vertical wheel keep
+    // what they did. The Playlist is checked in the three layouts. Included in the app class of Main.cpp.
+    bool runHWheel254Test (const juce::String& reportPath)
+    {
+        juce::LookAndFeel::setDefaultLookAndFeel (&lookAndFeel);
+        const juce::ScopedValueSetter<bool> shown (lynx::ui::showingForShots(), true);
+        using namespace lynx;
+        const auto motionBefore = ui::motion::enabled();
+        ui::motion::enabled() = false; // (the wheel jumps: no glide to wait for)
+        juce::String text;
+        bool allOk = true;
+        const auto check = [&text, &allOk] (const juce::String& what, bool ok) {
+            text << (ok ? "ok   " : "FAIL ") << what << "\n";
+            allOk = allOk && ok;
+        };
+        const auto mouseOn = [] (juce::Component& target, juce::Point<int> p, juce::ModifierKeys mods) {
+            auto source = juce::Desktop::getInstance().getMainMouseSource();
+            const auto now = juce::Time::getCurrentTime();
+            return juce::MouseEvent (source, p.toFloat(), mods, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, &target, &target, now, p.toFloat(), now, 1, false);
+        };
+        constexpr float notch = 60.0f / 256.0f;
+        const auto tilt = [notch] (int notches) { // (> 0: to the right)
+            juce::MouseWheelDetails w {};
+            w.deltaX = notches > 0 ? -notch : notch;
+            return w;
+        };
+        const auto none = juce::ModifierKeys();
+        const auto shiftKey = juce::ModifierKeys (juce::ModifierKeys::shiftModifier);
+        const auto near = [] (double a, double b) { return std::abs (a - b) < 1.0e-6; };
+
+        // a song long enough to scroll: 64 bars of a 1-bar pattern on track 1, a 16-bar pattern of notes, 40 inserts
+        auto song = Song::makeDefault();
+        song.mode = PlayMode::song;
+        auto& p = song.patterns[0];
+        for (int k = 0; k < 64; ++k)
+        {
+            Note n;
+            n.channel = 4;
+            n.start = k * ppq;
+            n.length = ppq / 2;
+            n.key = 60 + k % 12;
+            p.notes.push_back (n);
+        }
+        song.playlist.clear();
+        for (int bar = 0; bar < 64; ++bar)
+            song.playlist.push_back ({ 0, 0, bar * 16 * ppq, 16 * ppq, 0 }); // (the 16-beat pattern, 64 times: 256 bars)
+        if (song.mixer.size() < 40)
+            song.mixer.resize (40);
+        AudioEngine offline (false);
+        offline.setSong (song);
+        MainComponent ui (offline, false);
+        ui.setSize (1920, 1080);
+        offline.dispatchPendingMessages();
+
+        // ---- the Playlist, in the Pattern, Clip-launch (its Arrangement) and Simple layouts
+        const auto playlistChecks = [&] (const juce::String& layout) {
+            auto& pl = ui.getPlaylistForSnapshot();
+            const auto at = juce::Point<int> (pl.getWidth() * 3 / 5, pl.getHeight() / 2);
+            const auto barTicks = (double) offline.getSong().barTicks();
+            text << "     " << layout << ": Playlist " << pl.getBounds().toString() << "\n";
+            for (const auto pixelsPerBar : { 16.0, 384.0 })
+            {
+                pl.setViewForSnapshot (pixelsPerBar, 8, 0);
+                const auto start = pl.scrollTicksForSnapshot();
+                const auto ppt = pixelsPerBar / barTicks;
+                pl.mouseWheelMove (mouseOn (pl, at, none), tilt (1));
+                pl.mouseWheelMove (mouseOn (pl, at, none), tilt (1));
+                const auto right = pl.scrollTicksForSnapshot() - start;
+                pl.mouseWheelMove (mouseOn (pl, at, none), tilt (-1));
+                const auto back = pl.scrollTicksForSnapshot() - start;
+                // (the view lands on whole pixels: within a pixel of 1.5 beats a notch)
+                const auto beats = [&] (double ticks) { return juce::String (ticks / ppq, 3); };
+                check (layout + ", " + juce::String (pixelsPerBar, 0) + " px a bar: two notches right = 3 beats later, one left = 1.5 beats back ("
+                           + beats (right) + ", " + beats (back) + ")",
+                       std::abs (right - 3.0 * ppq) <= 1.0 / ppt + 1.0e-6 && std::abs (back - 1.5 * ppq) <= 1.0 / ppt + 1.0e-6);
+                // Shift+wheel over the clips (FL's nudge: over an empty part nothing moves) and a trackpad's sideways swipe
+                // (80 x 7 px a whole unit): as before
+                pl.setViewForSnapshot (pixelsPerBar, 8, 0);
+                juce::MouseWheelDetails shiftDown {};
+                shiftDown.deltaY = -notch;
+                pl.mouseWheelMove (mouseOn (pl, at, shiftKey), shiftDown);
+                const auto shifted = (pl.scrollTicksForSnapshot() - start) * ppt;
+                pl.setViewForSnapshot (pixelsPerBar, 8, 0);
+                juce::MouseWheelDetails swipe {};
+                swipe.deltaX = -0.1f;
+                swipe.isSmooth = true;
+                pl.mouseWheelMove (mouseOn (pl, at, none), swipe);
+                const auto swiped = (pl.scrollTicksForSnapshot() - start) * ppt;
+                check (layout + ", " + juce::String (pixelsPerBar, 0) + " px a bar: Shift+wheel does not scroll (FL's nudge), a trackpad swipe 56 px, as before ("
+                           + juce::String (shifted, 1) + ", " + juce::String (swiped, 1) + ")",
+                       std::abs (shifted) < 1.0e-6 && std::abs (swiped - 56.0) <= 1.0);
+            }
+        };
+        ui.showPanelsForSnapshot ({ workspace::Panel::playlist });
+        offline.dispatchPendingMessages();
+        playlistChecks ("Pattern layout");
+        ui.setClipLaunchWorkflow (true);
+        ui.showPanelsForSnapshot ({ workspace::Panel::playlist });
+        ui.setClipGridView (PlaylistArea::GridView::song);
+        offline.dispatchPendingMessages();
+        playlistChecks ("Clip-launch layout");
+        ui.setLayoutStyle (layoutstyle::Style::simple);
+        offline.dispatchPendingMessages();
+        playlistChecks ("Simple layout");
+        ui.setLayoutStyle (layoutstyle::Style::pattern);
+        offline.dispatchPendingMessages();
+
+        // ---- the Piano roll: 1.5 beats a notch at two zooms
+        {
+            ui.showPanelsForSnapshot ({ workspace::Panel::pianoRoll });
+            offline.setSelectedChannel (4);
+            offline.dispatchPendingMessages();
+            auto& pr = ui.getPianoRollForSnapshot();
+            const auto at = juce::Point<int> (pr.getWidth() * 3 / 5, pr.getHeight() / 3);
+            text << "     Piano roll " << pr.getBounds().toString() << "\n";
+            for (const auto* zoom : { "pianoRoll.zoom2", "pianoRoll.zoom1" })
+            {
+                pr.runAction (zoom);
+                pr.setViewForTests (4.0 * ppq, 16, 66);
+                const auto start = pr.scrollTicksForTests();
+                const auto ppt = pr.pixelsPerTickForTests();
+                pr.mouseWheelMove (mouseOn (pr, at, none), tilt (1));
+                pr.mouseWheelMove (mouseOn (pr, at, none), tilt (1));
+                const auto right = pr.scrollTicksForTests() - start;
+                pr.mouseWheelMove (mouseOn (pr, at, none), tilt (-1));
+                const auto back = pr.scrollTicksForTests() - start;
+                check (juce::String ("Piano roll, ") + juce::String (ppt * 4 * ppq, 0) + " px a bar: two notches right = 3 beats, one left = 1.5 beats back ("
+                           + juce::String (right / ppq, 3) + ", " + juce::String (back / ppq, 3) + ")",
+                       near (right, 3.0 * ppq) && near (back, 1.5 * ppq));
+                // Shift+wheel (80 px a notch sideways) and a trackpad's swipe (60 x 7 px a whole unit): as before
+                pr.setViewForTests (4.0 * ppq, 16, 66);
+                juce::MouseWheelDetails shiftDown {};
+                shiftDown.deltaY = -notch;
+                pr.mouseWheelMove (mouseOn (pr, at, shiftKey), shiftDown);
+                const auto shifted = (pr.scrollTicksForTests() - start) * ppt;
+                pr.setViewForTests (4.0 * ppq, 16, 66);
+                juce::MouseWheelDetails swipe {};
+                swipe.deltaX = -0.1f;
+                swipe.isSmooth = true;
+                pr.mouseWheelMove (mouseOn (pr, at, none), swipe);
+                const auto swiped = (pr.scrollTicksForTests() - start) * ppt;
+                check ("Piano roll: Shift+wheel 80 px, a trackpad swipe 42 px, as before (" + juce::String (shifted, 1) + ", " + juce::String (swiped, 1) + ")",
+                       std::abs (shifted - 80.0) <= 0.5 && std::abs (swiped - 42.0) <= 0.5);
+            }
+        }
+
+        // ---- the Mixer: one insert a notch, stopped at the first one
+        {
+            ui.showPanelsForSnapshot ({ workspace::Panel::mixer });
+            offline.dispatchPendingMessages();
+            auto& strips = ui.getMixerForSnapshot().getStripsForSnapshot();
+            auto* view = strips.findParentComponentOfClass<juce::Viewport>();
+            const auto width = strips.widthOf (5);
+            if (view == nullptr)
+                check ("Mixer: its viewport", false);
+            else
+            {
+                view->setViewPosition (0, 0);
+                const auto at = juce::Point<int> (view->getViewWidth() / 2, strips.getHeight() - 20);
+                for (int k = 0; k < 3; ++k)
+                    strips.mouseWheelMove (mouseOn (strips, at + juce::Point<int> (view->getViewPositionX(), 0), none), tilt (1));
+                const auto right = view->getViewPositionX();
+                for (int k = 0; k < 5; ++k)
+                    strips.mouseWheelMove (mouseOn (strips, at + juce::Point<int> (view->getViewPositionX(), 0), none), tilt (-1));
+                const auto back = view->getViewPositionX();
+                check ("Mixer: three notches right = three inserts (" + juce::String (right) + " px, an insert " + juce::String (width)
+                           + " px), five left stop at the first (" + juce::String (back) + ")",
+                       right == 3 * width && back == 0);
+            }
+        }
+
+        // ---- the Browser: its lists take the horizontal wheel as the vertical one (right = up), as FL's
+        {
+            auto& browser = ui.getBrowserForSnapshot();
+            check ("Browser: its folder list takes the horizontal wheel", dynamic_cast<ui::TiltViewport*> (browser.treeViewForTests()) != nullptr);
+            ui::TiltViewport list;
+            juce::Component tall;
+            tall.setSize (300, 3000);
+            list.setViewedComponent (&tall, false);
+            list.setScrollBarsShown (true, false);
+            list.setSize (300, 400);
+            list.setViewPosition (0, 1000);
+            list.mouseWheelMove (mouseOn (list, { 100, 100 }, none), tilt (1));
+            const auto up = list.getViewPositionY();
+            list.mouseWheelMove (mouseOn (list, { 100, 100 }, none), tilt (-1));
+            list.mouseWheelMove (mouseOn (list, { 100, 100 }, none), tilt (-1));
+            const auto down = list.getViewPositionY();
+            juce::MouseWheelDetails wheelUp {};
+            wheelUp.deltaY = notch;
+            list.setViewPosition (0, 1000);
+            list.mouseWheelMove (mouseOn (list, { 100, 100 }, none), wheelUp);
+            const auto vertical = list.getViewPositionY();
+            check ("Browser list: a notch right scrolls up as the wheel turned up (" + juce::String (up) + " / " + juce::String (vertical)
+                       + "), two left scroll down past the start (" + juce::String (down) + ")",
+                   up < 1000 && up == vertical && down > 1000);
+        }
+
+       #if JUCE_LINUX
+        // ---- X11 end to end (the JUCE patch fix 190ou): XTest presses buttons 7 and 6 over a window of ours; JUCE must
+        // deliver them as the horizontal wheel (7 = right = deltaX < 0, 6 = left = deltaX > 0). Needs an X server.
+        if (juce::SystemStats::getEnvironmentVariable ("DISPLAY", {}).isNotEmpty())
+        {
+            struct Catcher final : juce::Component
+            {
+                float x = 0.0f, y = 0.0f;
+                int events = 0;
+                void mouseWheelMove (const juce::MouseEvent&, const juce::MouseWheelDetails& w) override { x += w.deltaX; y += w.deltaY; ++events; }
+                void paint (juce::Graphics& g) override { g.fillAll (juce::Colours::black); }
+            };
+            const auto pumpFor = [] (int ms, const std::function<bool()>& until) {
+                const auto end = juce::Time::getMillisecondCounter() + (juce::uint32) ms;
+                while (juce::Time::getMillisecondCounter() < end && ! (until && until()))
+                {
+                    for (int i = 0; i < 256 && juce::detail::dispatchNextMessageOnSystemQueue (true); ++i) {}
+                    juce::Thread::sleep (10);
+                }
+            };
+            auto* x11 = dlopen ("libX11.so.6", RTLD_NOW);
+            auto* xtst = dlopen ("libXtst.so.6", RTLD_NOW);
+            using OpenDisplay = void* (*) (const char*);
+            using CloseDisplay = int (*) (void*);
+            using Flush = int (*) (void*);
+            using FakeMotion = int (*) (void*, int, int, int, unsigned long);
+            using FakeButton = int (*) (void*, unsigned int, int, unsigned long);
+            auto open = x11 != nullptr ? (OpenDisplay) dlsym (x11, "XOpenDisplay") : nullptr;
+            auto close = x11 != nullptr ? (CloseDisplay) dlsym (x11, "XCloseDisplay") : nullptr;
+            auto flush = x11 != nullptr ? (Flush) dlsym (x11, "XFlush") : nullptr;
+            auto motion = xtst != nullptr ? (FakeMotion) dlsym (xtst, "XTestFakeMotionEvent") : nullptr;
+            auto button = xtst != nullptr ? (FakeButton) dlsym (xtst, "XTestFakeButtonEvent") : nullptr;
+            auto* display = open != nullptr ? open (nullptr) : nullptr;
+            if (display == nullptr || motion == nullptr || button == nullptr || flush == nullptr)
+                text << "     X11: no XTest here (" << (xtst == nullptr ? "no libXtst" : "no display") << "): the end-to-end check is skipped\n";
+            else
+            {
+                const auto scale = juce::Desktop::getInstance().getGlobalScaleFactor();
+                juce::Desktop::getInstance().setGlobalScaleFactor (1.0f);
+                Catcher catcher;
+                catcher.setBounds (200, 200, 400, 300);
+                catcher.addToDesktop (0);
+                catcher.setVisible (true);
+                catcher.toFront (false);
+                pumpFor (500, {});
+                const auto press = [&] (unsigned int b) {
+                    motion (display, -1, 400, 350, 0);
+                    button (display, b, 1, 0);
+                    button (display, b, 0, 0);
+                    flush (display);
+                };
+                press (7);
+                pumpFor (2000, [&catcher] { return catcher.events >= 1; });
+                const auto right = catcher.x, rightY = catcher.y;
+                const auto first = catcher.events;
+                press (6);
+                press (6);
+                pumpFor (2000, [&catcher, first] { return catcher.events >= first + 2; });
+                const auto left = catcher.x - right;
+                check ("X11: button 7 is the horizontal wheel to the right, 6 to the left (deltaX " + juce::String (right, 3) + ", then "
+                           + juce::String (left, 3) + " for two, deltaY " + juce::String (rightY, 3) + ", " + juce::String (catcher.events) + " events)",
+                       first == 1 && right < 0.0f && rightY == 0.0f && left > 0.0f && catcher.events == 3);
+                catcher.removeFromDesktop();
+                juce::Desktop::getInstance().setGlobalScaleFactor (scale);
+                close (display);
+            }
+        }
+       #endif
+
+        ui::motion::enabled() = motionBefore;
+        text << "result=" << (allOk ? "OK" : "FAILED") << "\n";
+        juce::File (reportPath).replaceWithText (text);
+        return allOk;
+    }

+ 15 - 0
src/Main.cpp

@@ -126,6 +126,10 @@
 #include "engine/ClapFormat.h"
 #include "engine/ClapTeardownTest.h"
 #include "engine/RenderAgainTest.h"
+#include "ui/TiltViewport.h"
+#if JUCE_LINUX
+ #include <dlfcn.h> // (round 190ou: --hwheel254test presses X11 buttons through XTest)
+#endif
 #include "engine/HostingTests.h"
 #include "core/EdisonFx.h"
 #include "engine/ProjectFile.h"
@@ -1912,6 +1916,16 @@ public:
             return;
         }
 
+        if (args.contains ("--hwheel254test"))
+        {
+            // LYNX --hwheel254test report.txt (round 190ou, issue #254): the horizontal wheel in the Playlist (three layouts),
+            // Piano roll, Mixer and Browser, off screen (src/HWheel254Test.inc)
+            const auto i = args.indexOf ("--hwheel254test");
+            setApplicationReturnValue (runHWheel254Test (args[i + 1].unquoted()) ? 0 : 1);
+            quit();
+            return;
+        }
+
         if (args.contains ("--renderagaintest"))
         {
             // LYNX --renderagaintest report.txt (round 190ou, engine/RenderAgainTest.cpp): offline renders made again
@@ -18900,6 +18914,7 @@ private:
 #include "DetailsShot190mf.inc" // round 190mf
 #include "DetailsShot190mk.inc" // round 190mk
 #include "DetailsShot190mp.inc" // round 190mp
+#include "HWheel254Test.inc" // round 190ou: issue #254, the horizontal wheel
 #include "DetailsShot190mr.inc" // round 190mr
 #include "DetailsShot190mv.inc" // round 190mv
 #include "DetailsShot190my.inc" // round 190my

+ 16 - 0
src/core/EditorGestures.h

@@ -302,6 +302,22 @@ inline WheelDelta normaliseWheel (double deltaX, double deltaY, bool smooth, boo
     return { deltaX / windowsWheelNotch / 7.0, deltaY / windowsWheelNotch / 7.0, true };
 }
 
+// --- the horizontal wheel (issue #254, round 190ou) ---------------------------------------------------------------
+// One notch of a tilt wheel or of a mouse's second (horizontal) wheel: Windows' WM_MOUSEHWHEEL, X11's buttons 6 / 7
+// (JUCE patch fix 190ou), a mouse's horizontal wheel on macOS. It comes as deltaX alone and not smooth. A trackpad's
+// sideways swipe is smooth and keeps its own path, and macOS turns Shift+wheel into deltaX with Shift held: that stays
+// Shift+wheel. +1 = a notch to the right (the view goes later), -1 to the left, 0 = not a horizontal wheel's notch.
+inline int horizontalWheelNotch (double deltaX, double deltaY, bool smooth, bool shift) noexcept
+{
+    if (smooth || shift || deltaY != 0.0 || deltaX == 0.0)
+        return 0;
+    return deltaX < 0.0 ? 1 : -1; // (JUCE: a tilt to the right is a negative deltaX, as on a trackpad)
+}
+
+// FL 2026 (round 190ou, Thief: the Playlist at 15.5 px a bar and the Piano roll at 384 px a bar): a notch of the
+// horizontal wheel moves the view 1.5 beats, whatever the zoom
+constexpr double horizontalWheelBeats = 1.5;
+
 // The zoom factor of one trackpad pinch event (macOS magnifyWithEvent, Windows GID_ZOOM: JUCE's mouseMagnify `scale`,
 // 1 = no change), limited so that one event never jumps more than x2.
 inline double pinchZoomFactor (double scale)

+ 3 - 2
src/ui/BrowserComponent.cpp

@@ -1,3 +1,4 @@
+#include "ui/TiltViewport.h"
 #include "ui/TypeAhead.h"
 #include "ui/PluginPresetMenu.h"
 #include "ui/ExternalDrag.h"
@@ -3815,7 +3816,7 @@ BrowserComponent::BrowserComponent (AudioEngine& e, Role r)
     loopPanel = std::make_unique<LoopPanel> (*this);
     addChildComponent (*loopPanel);
     sidebar = std::make_unique<LiveSidebar> (*this);
-    sidebarView = std::make_unique<juce::Viewport>();
+    sidebarView = std::make_unique<ui::TiltViewport>();
     sidebarView->setViewedComponent (sidebar.get(), false);
     sidebarView->setScrollBarsShown (true, false);
     sidebarView->setScrollBarThickness (8);
@@ -3895,7 +3896,7 @@ BrowserComponent::BrowserComponent (AudioEngine& e, Role r)
 
     for (auto [view, list] : { std::pair { &treeView, tree.get() }, std::pair { &resultsView, results.get() } })
     {
-        *view = std::make_unique<juce::Viewport>();
+        *view = std::make_unique<ui::TiltViewport>(); // (issue #254: the horizontal wheel scrolls the list as FL's Browser)
         (*view)->setViewedComponent (list, false);
         (*view)->setScrollBarsShown (true, false);
         (*view)->setScrollBarThickness (10);

+ 1 - 0
src/ui/BrowserComponent.h

@@ -191,6 +191,7 @@ public:
     void paintOverChildren (juce::Graphics& g) override; // the outline while a folder is dragged over
     bool folderDragOver = false;
     void reloadUserFolders() { rebuildRoots(); } // after the list changed elsewhere (Settings > Files)
+    juce::Viewport* treeViewForTests() const noexcept { return treeView.get(); } // (round 190ou: --hwheel254test)
     void setSearchForSnapshot (const juce::String& text);
     // For snapshots: selects (and "previews" without sound) the first audio file under the first folder,
     // and puts the mouse over the row after it.

+ 14 - 0
src/ui/MixerComponent.cpp

@@ -3232,6 +3232,20 @@ juce::PopupMenu MixerStrips::buildSendMenu (int t)
 
 void MixerStrips::mouseWheelMove (const juce::MouseEvent& e, const juce::MouseWheelDetails& wheel)
 {
+    // issue #254 (round 190ou): a notch of the horizontal wheel (a tilt wheel, a second wheel) scrolls the strips one
+    // insert sideways, as in FL 2026 (Thief: three notches, three inserts), wherever the mouse is over them
+    if (! flmods::ctrl (e.mods) && ! e.mods.isAltDown())
+        if (const auto w = flmods::normalisedWheel (wheel); gesture::horizontalWheelNotch (w.deltaX, w.deltaY, w.isSmooth, e.mods.isShiftDown()) != 0)
+        {
+            const auto notch = gesture::horizontalWheelNotch (w.deltaX, w.deltaY, w.isSmooth, false);
+            if (auto* view = findParentComponentOfClass<juce::Viewport>())
+            {
+                const auto room = juce::jmax (0, getWidth() - view->getViewWidth());
+                view->setViewPosition (juce::jlimit (0, room, view->getViewPositionX() + notch * spec().stripWidth), view->getViewPositionY());
+            }
+            return;
+        }
+
     if (const auto i = vcaAt (e.x); i >= 0 && ! ui::wheelScrolling() && vcaPartAt (i, e.getPosition()) == Part::fader)
     {
         if (const auto v = ui::wheelValue (engine.getSong().vcas[(std::size_t) i].level, e, wheel, vcaSpec (i)))

+ 10 - 0
src/ui/PianoRollComponent.cpp

@@ -5760,6 +5760,16 @@ void PianoRollComponent::mouseWheelMove (const juce::MouseEvent& e, const juce::
     const auto ctrl = flmods::ctrl (e.mods), alt = e.mods.isAltDown(), shift = e.mods.isShiftDown();
     const auto overGrid = gridArea().contains (e.getPosition()) || velocityArea().contains (e.getPosition());
 
+    // issue #254 (round 190ou): a notch of the horizontal wheel (a tilt wheel, a second wheel) moves the view 1.5 beats
+    // sideways whatever the zoom, as in FL 2026 (a trackpad's swipe and Shift+wheel keep their own ways below)
+    if (! ctrl && ! alt)
+        if (const auto notch = gesture::horizontalWheelNotch (wheel.deltaX, wheel.deltaY, wheel.isSmooth, shift); notch != 0)
+        {
+            gliding = false;
+            glideBy (notch * gesture::horizontalWheelBeats * ppq, 0.0);
+            return;
+        }
+
     // the wheel over the zoom wheel: one zoom level a notch (FL: the only wheel gesture of the vertical zoom)
     if (zoomWheelArea().contains (e.getPosition()))
     {

+ 2 - 0
src/ui/PianoRollComponent.h

@@ -322,6 +322,8 @@ public:
     int eventPaneBarTopForTests() const noexcept { return eventPaneBarTop; }
     // --undogesture190jv (round 190jv): the middle of the row of `key` at `tick`, in this component's coordinates
     // round 190mq (issues #211, #212, #213): the view and the time selection, for --issueshot190mq
+    double scrollTicksForTests() const noexcept { return scrollTicks; } // (round 190ou: --hwheel254test)
+    double pixelsPerTickForTests() const noexcept { return pixelsPerTick; }
     void setViewForTests (double firstTick, int rowPixels, int centreKey)
     {
         scrollTicks = firstTick;

+ 9 - 0
src/ui/PlaylistComponent.cpp

@@ -14425,6 +14425,15 @@ void PlaylistComponent::mouseWheelMove (const juce::MouseEvent& e, const juce::M
         return;
     }
 
+    // issue #254 (round 190ou): a notch of the horizontal wheel (a tilt wheel, a second wheel) moves the view 1.5 beats
+    // sideways whatever the zoom, as in FL 2026 (a trackpad's swipe and Shift+wheel keep their own ways below)
+    if (! ctrl && ! alt)
+        if (const auto notch = gesture::horizontalWheelNotch (wheel.deltaX, wheel.deltaY, wheel.isSmooth, shift); notch != 0)
+        {
+            glideBy (notch * gesture::horizontalWheelBeats * ppq, 0.0);
+            return;
+        }
+
     // issue #154: the wheel scrolls a linked header's effects list when it has more rows than fit
     if (! shift && ! ctrl && ! alt && insertsWheel (e, wheel.deltaY))
         return;

+ 32 - 0
src/ui/TiltViewport.h

@@ -0,0 +1,32 @@
+#pragma once
+
+// Issue #254 (round 190ou): a list that only scrolls up and down takes a notch of the horizontal wheel (a tilt wheel, a
+// second wheel) as a notch of the vertical one, as FL 2026's Browser does: a tilt to the right scrolls up, as the
+// wheel turned up. JUCE's Viewport ignores the horizontal wheel when it has no horizontal scroll bar. A trackpad's
+// swipe and Shift+wheel are left as they are (core/EditorGestures.h, horizontalWheelNotch).
+
+#include <juce_gui_basics/juce_gui_basics.h>
+
+#include "core/EditorGestures.h"
+#include "ui/FlMods.h"
+
+namespace lynx::ui
+{
+class TiltViewport : public juce::Viewport
+{
+public:
+    void mouseWheelMove (const juce::MouseEvent& e, const juce::MouseWheelDetails& wheel) override
+    {
+        const auto w = flmods::normalisedWheel (wheel);
+        if (! getHorizontalScrollBar().isVisible() && gesture::horizontalWheelNotch (w.deltaX, w.deltaY, w.isSmooth, e.mods.isShiftDown()) != 0)
+        {
+            auto vertical = wheel;
+            vertical.deltaY = -wheel.deltaX;
+            vertical.deltaX = 0.0f;
+            juce::Viewport::mouseWheelMove (e, vertical);
+            return;
+        }
+        juce::Viewport::mouseWheelMove (e, wheel);
+    }
+};
+} // namespace lynx::ui

+ 31 - 0
tests/HWheel254Tests.inc

@@ -0,0 +1,31 @@
+// Issue #254 (round 190ou): the horizontal wheel (a tilt wheel, a mouse's second wheel). core/EditorGestures.h:
+// horizontalWheelNotch tells its notches from a trackpad's swipe and from macOS's Shift+wheel; FL 2026's step is 1.5 beats.
+// The views themselves (Playlist, Piano roll, Mixer, Browser) are checked by LYNX --hwheel254test (src/HWheel254Test.inc).
+
+#include "core/EditorGestures.h"
+
+TEST (hwheel254_notches_of_the_horizontal_wheel_only)
+{
+    using namespace lynx::gesture;
+    constexpr double notch = 60.0 / 256.0; // (JUCE on Windows: WM_MOUSEHWHEEL's 120, halved, over 256)
+    // Windows: a tilt to the right is a negative deltaX (JUCE turns the sign, as for a trackpad): the view goes later
+    CHECK (horizontalWheelNotch (-notch, 0.0, false, false) == 1);
+    CHECK (horizontalWheelNotch (notch, 0.0, false, false) == -1);
+    // X11's buttons 6 / 7 (JUCE patch fix 190ou): 50 / 256 a press
+    CHECK (horizontalWheelNotch (-50.0 / 256.0, 0.0, false, false) == 1);
+    CHECK (horizontalWheelNotch (50.0 / 256.0, 0.0, false, false) == -1);
+    // not a horizontal wheel: the vertical wheel, a trackpad's swipe (smooth), macOS's Shift+wheel (deltaX with Shift),
+    // a diagonal swipe, nothing
+    CHECK (horizontalWheelNotch (0.0, notch, false, false) == 0);
+    CHECK (horizontalWheelNotch (-0.05, 0.0, true, false) == 0);
+    CHECK (horizontalWheelNotch (-notch, 0.0, false, true) == 0);
+    CHECK (horizontalWheelNotch (-notch, notch, false, false) == 0);
+    CHECK (horizontalWheelNotch (0.0, 0.0, false, false) == 0);
+    // Windows' pieces of a notch (a high-resolution wheel, a touchpad) are made smooth first and keep their own path
+    const auto piece = normaliseWheel (-notch / 4.0, 0.0, false, true);
+    CHECK (piece.smooth && horizontalWheelNotch (piece.x, piece.y, piece.smooth, false) == 0);
+    const auto whole = normaliseWheel (-notch, 0.0, false, true);
+    CHECK (! whole.smooth && horizontalWheelNotch (whole.x, whole.y, whole.smooth, false) == 1);
+    // FL 2026's step (measured at two zooms, 15.5 and 384 px a bar): 1.5 beats a notch
+    CHECK (horizontalWheelBeats == 1.5);
+}

+ 1 - 0
tests/tests.cpp

@@ -18074,3 +18074,4 @@ TEST (fl_low_lifter_matches_fl_engine)
 #include "Sections190olTests.inc" // round 190ol (0.1.31): the Sections lane (P1) and Simple time signature changes (P6)
 #include "Research190onTests.inc" // round 190on: command palette (P2), Tab to transient (P8), stacked lanes (P10), removing a guest
 #include "Perf190okTests.inc" // round 190ok: safe overloads (P24), generator smart disable (D2), the smart-disable tip (D1), fast maths (D3)
+#include "HWheel254Tests.inc" // round 190ou: issue #254, the horizontal wheel