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

osc.lua: don't place the overlay above other ones #15189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guidocella
Copy link
Contributor

@guidocella guidocella commented Oct 27, 2024

Stop setting the z of the OSD overlay. This prevents the console from being drawn below the box layout when clicking buttons with visibility=always.

This reverts 9c22d6b and 86d24b0.

Copy link

github-actions bot commented Oct 27, 2024

Download the artifacts for this pull request:

Windows
macOS

@na-na-hi
Copy link
Contributor

Leaving the z to 0 doesn't work because the order is essentially random. It fails when loading/unloading OSC at runtime.

Also with visibility=auto the console can render above the player control, which still responds to mouse despite the console is a layer above.

When opening select.lua with layout=box and visibility=always, it is
drawn below the OSC. Fix it by using z = -1 with visibility always.

With bottombar and topbar layouts the console doesn't overlap with the
OSC because it reads user-data/osc/margins, so z doesn't matter.

This reverts 9c22d6b and 86d24b0.
-- Draw the OSC above the console with visibility auto because the OSC
-- receives mouse clicks, and below with visibility always because that is
-- needed with box layout.
state.osd.z = user_opts.visibility == "auto" and z or -1
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this condition. Comment is telling that it is needed for box, but it checks visibility?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IIt's needed for box with visibility always. It is indifferent for bar layouts because they don't overlap thanks to user-data margins. For visibility auto it's more expected to have the OSC on top because it receives clicks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants