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

Remove global action container input queue workaround #24610

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Aug 21, 2023

As described in #24248, the workaround employed by GlobalActionContainer, wherein it tried to handle actions with priority before its children by being placed in front of the children and not actually containing said children, is blocking the resolution of some rather major input handling issues that allow key releases to be received by deparented drawables.

To resolve, migrate GlobalActionContainer to use Prioritised, which can be done without regressing certain mouse button flows after ppy/osu-framework#5966.

As described in ppy#24248, the workaround employed by
`GlobalActionContainer`, wherein it tried to handle actions with
priority before its children by being placed in front of the children
and not _actually containing_ said children, is blocking the resolution
of some rather major input handling issues that allow key releases to be
received by deparented drawables.

To resolve, migrate `GlobalActionContainer` to use `Prioritised`, which
can be done without regressing certain mouse button flows after
ppy/osu-framework#5966.
Comment on lines +395 to +406
Child = CreateScalingContainer().WithChild(globalBindings = new GlobalActionContainer(this)
{
(GlobalCursorDisplay = new GlobalCursorDisplay
Children = new Drawable[]
{
RelativeSizeAxes = Axes.Both
}).WithChild(content = new OsuTooltipContainer(GlobalCursorDisplay.MenuCursor)
{
RelativeSizeAxes = Axes.Both
}),
// to avoid positional input being blocked by children, ensure the GlobalActionContainer is above everything.
globalBindings = new GlobalActionContainer(this)
(GlobalCursorDisplay = new GlobalCursorDisplay
{
RelativeSizeAxes = Axes.Both
}).WithChild(content = new OsuTooltipContainer(GlobalCursorDisplay.MenuCursor)
{
RelativeSizeAxes = Axes.Both
}),
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of interest, aside from the usage with CreateScalingContainer(), is there a reason this uses the WithChild() style of hierarchy creation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, not in this case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just stylistic. Was used to avoid too much nesting where it made things hard to read (due to nested object initialisers and such).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, in this case it's due to the abstracted out constructor meaning it's the only way we could structure this hierarchically.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one usage by CreateScalingContainer() is required yeah. The other could use plain .Child but it's like whatever.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out it's required due to the inner reference to GlobalCursorDisplay.MenuCursor and execution order woes 😅

@peppy peppy self-requested a review August 22, 2023 03:28
@peppy peppy force-pushed the remove-global-action-container-hack branch from 200247f to 5454d1c Compare August 22, 2023 03:42
@peppy peppy merged commit 2937dce into ppy:master Aug 22, 2023
@bdach bdach deleted the remove-global-action-container-hack branch January 23, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants