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

tree/view: Send estimated configure before mapping #8313

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

Conversation

kennylevinsen
Copy link
Member

This is hacky but allows us to reuse most of the arrange code to calculate the geometry if a single container was to be added, without causing any changes at this state.

Seems to work locally, including with smart borders (which were slightly annoying).

Sending 0,0 as configure dimensions indicate that the client is free to
pick its own dimensions. When tiling, the client needs to strictly
adhere to the tile dimensions. Sway's handling of this has been to send
a the appropriate dimensions in a new configure when the surface is
mapped, leading to the first buffer most likely being incorrectly sized.

Introduce a view_premap which goes through part of the mapping dance,
calculating what the container dimensions would be at this time and
sending it as a configure. This is only an estimate and inherently
racey if the user very quickly changes focused workspace between surface
role commit and first attached buffer, but when it works the client has
a chance of getting the first buffer right, when it doesn't it is no
worse than it would have been otherwise.

Fixes: swaywm#2176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant