Use get_unconstrained_geometry
function for popup position
#1122
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'sget_unconstrained_geometry
to disable resizing. Maybe it should take aConstraintAdjustment
argument, that is combined with the one set by the client?get_anchor_point()
could also be moved to Smithay as a method ofPositionerState
since it's just a straightforward implementation of what the protocol specifies.