From 086cdce94d899cc2a10484c8735ae441f4642f4e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 12 Aug 2025 17:20:32 +0900 Subject: [PATCH] Fix "reveal background" triggering in one more case it shouldn't Closes https://github.com/ppy/osu/issues/34393 again. Hopefully for the last time. --- osu.Game/Graphics/Carousel/Carousel.cs | 5 +++++ .../Graphics/Carousel/Carousel_ScrollContainer.cs | 13 ++++++++----- osu.Game/Screens/SelectV2/SongSelect.cs | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/osu.Game/Graphics/Carousel/Carousel.cs b/osu.Game/Graphics/Carousel/Carousel.cs index 414aba1a2e..7b5aea08b6 100644 --- a/osu.Game/Graphics/Carousel/Carousel.cs +++ b/osu.Game/Graphics/Carousel/Carousel.cs @@ -71,6 +71,11 @@ namespace osu.Game.Graphics.Carousel /// public bool IsFiltering => !filterTask.IsCompleted; + /// + /// Whether absolute scrolling is currently triggered. + /// + public bool AbsoluteScrolling => Scroll.AbsoluteScrolling; + /// /// The number of times filter operations have been triggered. /// diff --git a/osu.Game/Graphics/Carousel/Carousel_ScrollContainer.cs b/osu.Game/Graphics/Carousel/Carousel_ScrollContainer.cs index 1027e7e1f2..accd74aa4b 100644 --- a/osu.Game/Graphics/Carousel/Carousel_ScrollContainer.cs +++ b/osu.Game/Graphics/Carousel/Carousel_ScrollContainer.cs @@ -120,9 +120,12 @@ namespace osu.Game.Graphics.Carousel #region Absolute scrolling - private bool absoluteScrolling; + /// + /// Whether absolute scrolling is currently triggered. + /// + public bool AbsoluteScrolling { get; private set; } - protected override bool IsDragging => base.IsDragging || absoluteScrolling; + protected override bool IsDragging => base.IsDragging || AbsoluteScrolling; public bool OnPressed(KeyBindingPressEvent e) { @@ -169,7 +172,7 @@ namespace osu.Game.Graphics.Carousel protected override bool OnMouseMove(MouseMoveEvent e) { - if (absoluteScrolling) + if (AbsoluteScrolling) { ScrollToAbsolutePosition(e.CurrentState.Mouse.Position); return true; @@ -181,10 +184,10 @@ namespace osu.Game.Graphics.Carousel private void beginAbsoluteScrolling(UIEvent e) { ScrollToAbsolutePosition(e.CurrentState.Mouse.Position); - absoluteScrolling = true; + AbsoluteScrolling = true; } - private void endAbsoluteScrolling() => absoluteScrolling = false; + private void endAbsoluteScrolling() => AbsoluteScrolling = false; #endregion diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index 26e835cdfd..0e3b6b3a61 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -849,7 +849,7 @@ namespace osu.Game.Screens.SelectV2 // For simplicity, disable this functionality on mobile. bool isTouchInput = e.CurrentState.Mouse.LastSource is ISourcedFromTouch; - if (e.PressedButtons.SequenceEqual([MouseButton.Left]) && !isTouchInput && mouseDownPriority) + if (!carousel.AbsoluteScrolling && !isTouchInput && mouseDownPriority) { revealingBackground = Scheduler.AddDelayed(() => {