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

Use get_unconstrained_geometry function for popup position #1122

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Jan 8, 2025

get_unconstrained_geometry was added to Smithay in Smithay/smithay#1256 (based on the cosmic-comp implementation) and is used in Anvil and Niri (at least). It would be good to avoid duplicating it.

But I've also noticed popup positioning not working very well. Not sure exactly is wrong with the existing cosmic-comp version, but it seems to not resize popups when it should, causing them to end up off screen.

There are a lot of different cases to consider here, but after some work, and comparison to Anvil, this version seems to be working pretty well, without the issues that I previously saw.

For unconstrain_xdg_popup_tile, this required adding an argument to Smithay's get_unconstrained_geometry to disable resizing. Maybe it should take a ConstraintAdjustment argument, that is combined with the one set by the client?

get_anchor_point() could also be moved to Smithay as a method of PositionerState since it's just a straightforward implementation of what the protocol specifies.

@Drakulix
Copy link
Member

Drakulix commented Jan 9, 2025

get_unconstrained_geometry was added to Smithay in Smithay/smithay#1256 (based on the cosmic-comp implementation) and is used in Anvil and Niri (at least). It would be good to avoid duplicating it.

This has been on my backlog for quite some time, thanks for taking care of it.

For unconstrain_xdg_popup_tile, this required adding an argument to Smithay's get_unconstrained_geometry to disable resizing. Maybe it should take a ConstraintAdjustment argument, that is combined with the one set by the client?

That sounds like a good approach to me.

get_anchor_point() could also be moved to Smithay as a method of PositionerState since it's just a straightforward implementation of what the protocol specifies.

👍

@ids1024 ids1024 changed the title WIP Use get_unconstrained_geometry function for popup position Use get_unconstrained_geometry function for popup position Jan 14, 2025
@ids1024 ids1024 requested a review from a team January 14, 2025 22:11
@ids1024 ids1024 marked this pull request as ready for review January 14, 2025 22:12
@Drakulix Drakulix merged commit 1a3494e into master Jan 14, 2025
7 of 9 checks passed
@ids1024 ids1024 deleted the popup-constraints branch January 15, 2025 15:55
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.

2 participants