Skip to content

Fix edge case offset handling in surface tree traversals#1954

Open
moggiesir wants to merge 1 commit intoSmithay:masterfrom
moggiesir:fix/surface-tree-offset-double-counting
Open

Fix edge case offset handling in surface tree traversals#1954
moggiesir wants to merge 1 commit intoSmithay:masterfrom
moggiesir:fix/surface-tree-offset-double-counting

Conversation

@moggiesir
Copy link
Copy Markdown

Description

Fix edge case offset handling in surface tree traversals by not including the offset of the surface passed in to the functions.

If a subsurface (that has an offset from parent) is passed in to bbox_from_surface_tree or under_from_surface_tree and the location parameter already accounts for the offset (which is typical), then the previous logic would return an erroneous bounding box (from the parent's top left to the subsurface tree's bottom right).

It seems like these functions assumed they would only be called with non-offset surfaces (e.g. top-level surfaces), and they are called that way within smithay, but they are not documented as such and they caused a weird bug in a compositor I'm creating.

Checklist

If a subsurface (that has an offset from parent) is passed in to
bbox_from_surface_tree or under_from_surface_tree and the location parameter
already accounts for the offset (which is typical), then the previous logic
would return an erroneous bounding box (from the parent's top left to the
subsurface tree's bottom right).

It seems like these functions assumed they would only be called with non-offset
surfaces (e.g. top-level surfaces), and they are called that way within
smithay, but they are not documented as such and they caused a weird bug in a
compositor I'm creating.
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.

1 participant