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

Add order rule for layers #7697

Merged
merged 1 commit into from
Sep 9, 2024
Merged

Add order rule for layers #7697

merged 1 commit into from
Sep 9, 2024

Conversation

darkwater
Copy link
Contributor

Describe your PR, what does it fix/add?

Adds an order rule for layers, like so:

layerrule = order 10, waybar
layerrule = order -5, fdls
layerrule = order 100, wvkbd

A higher order means the layer is closer to the edge of the monitor.

Closes #7476

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

Idk where the best place to do the sorting is, I just put it somewhere where it works.

The best sorting algorithm to use would be insertion sort as usually there will be 0 or 1 elements out of order, idk what std::stable_sort does.

Is it ready for merging, or does it need work?

Fine to merge probably

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

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

also will stable sort do...?

If the priority is changed at runtime... it might misalign stuff (wrt creation time). Though that's a minor concern I think...?

src/render/Renderer.cpp Show resolved Hide resolved
@darkwater
Copy link
Contributor Author

The stable part means that if all layers have the same priority, nothing will happen and they stay sorted by creation time. If you change some priorities and then change them all back to 0, they won't be resorted by creation time, and will remain in whatever order they were left in. I don't think that's an issue, unless someone wants to script something where they temporary bring a layer to the top/bottom, and then want to revert it to its original position. If we want to "fix" that we'd need to track creation time or sort at every draw into a new collection.

@vaxerski
Copy link
Member

vaxerski commented Sep 8, 2024

....or keep two lists

@darkwater
Copy link
Contributor Author

Would you want that before merging this? It sounds like a very niche problem

@vaxerski
Copy link
Member

vaxerski commented Sep 9, 2024

no, it's fine

@vaxerski vaxerski merged commit 0442106 into hyprwm:main Sep 9, 2024
11 checks passed
@Aqa-Ib
Copy link
Contributor

Aqa-Ib commented Sep 9, 2024

Needs wiki MR. I am trying to make the layerrule work with waybar and wvkbd but I am not able.

@kRHYME7

This comment was marked as off-topic.

@Aqa-Ib
Copy link
Contributor

Aqa-Ib commented Sep 10, 2024

@kRHYME7 did you manage to make this work ? How please?

@kRHYME7
Copy link

kRHYME7 commented Sep 10, 2024

Nah, I'm dumb. What this PR means is assigning the priority of layers to be closer to the edge of the monitor.

I really thought that it handles the Z axis /level of a layer.

@Aqa-Ib
Copy link
Contributor

Aqa-Ib commented Sep 10, 2024

Someone explain to make a wiki mr please.

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.

Add priority/order rule for layers
4 participants