From c633e2e9521b9c9ae86defae674a0d65b16efabd Mon Sep 17 00:00:00 2001 From: Jason Won Date: Tue, 26 Oct 2021 16:24:53 -0400 Subject: [PATCH] only propagate unmodified right click --- .../Visual/Editing/TestSceneComposerSelection.cs | 4 ++-- .../Screens/Edit/Compose/Components/BlueprintContainer.cs | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/Editing/TestSceneComposerSelection.cs b/osu.Game.Tests/Visual/Editing/TestSceneComposerSelection.cs index 9aae595808..dddd9f07ab 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneComposerSelection.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneComposerSelection.cs @@ -57,8 +57,8 @@ namespace osu.Game.Tests.Visual.Editing moveMouseToObject(() => addedObject); AddStep("right click", () => InputManager.Click(MouseButton.Right)); - AddAssert("hitobject selected", () => EditorBeatmap.SelectedHitObjects.Single() == addedObject); - AddAssert("context menu is visible", () => contextMenuContainer.ChildrenOfType().Single().State == MenuState.Open); + AddUntilStep("hitobject selected", () => EditorBeatmap.SelectedHitObjects.Single() == addedObject); + AddUntilStep("context menu is visible", () => contextMenuContainer.ChildrenOfType().Single().State == MenuState.Open); } [Test] diff --git a/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs b/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs index 0de99831f2..7391c1a642 100644 --- a/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs +++ b/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs @@ -113,8 +113,11 @@ namespace osu.Game.Screens.Edit.Compose.Components // check if selection has occurred if (selectionPerformed) { - // propagate right click to show context menu on selection - return e.Button != MouseButton.Right; + // only unmodified right click should show context menu + var shouldShowContextMenu = e.Button == MouseButton.Right && !e.ShiftPressed && !e.AltPressed && !e.SuperPressed; + + // stop propagation if not showing context menu + return !shouldShowContextMenu; } // even if a selection didn't occur, a drag event may still move the selection.