Fix negative dimensions in scene rect sizing#9080
Open
beeblebrox wants to merge 1 commit into
Open
Conversation
53a2ee3 to
a948ab3
Compare
During cross-output tiling drags, computed box dimensions can become negative due to coordinate transforms and thickness subtractions. This triggers the assertion in wlr_scene_rect_set_size() which requires width >= 0 && height >= 0, crashing the compositor. Clamp dimensions to zero in three locations: - resize_box() in seatop_move_tiling.c for the WLR_EDGE_NONE case - update_indicator() in seatop_move_tiling.c as a safety net - arrange_container() in transaction.c for border width (matching the existing vert_border_height clamping from 62fd8c4) - update_rect_list() in container.c for pixman region boxes This is the same class of bug fixed by 62fd8c4 (height clamping) and partially addressed by c2d6aff (too-many-containers guards).
a948ab3 to
da901a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
wlr_scene_rect_set_sizeassertionwidth >= 0 && height >= 0fails attypes/scene/wlr_scene.c:739titlebar_padding 1 10000#8120 (fixed by 62fd8c4 for height, but width was missed)Root Cause
During cross-output tiling drags, box dimensions can go negative via:
resize_box()subtractingthickness * 2from width/height (WLR_EDGE_NONE case)wlr_scene_rect_set_sizeinarrange_container()Changes
resize_box()andupdate_indicator()arrange_container()(matches existing height clamp from 62fd8c4)update_rect_list()Environment
Stack Trace
Test Plan