Skip to content

fix: Post error for negative toplevel size hints - #2187

Merged
Drakulix merged 1 commit into
Smithay:masterfrom
EVV1E:error_negative_size_hint
Sep 29, 2026
Merged

Drakulix merged 1 commit into
Smithay:masterfrom
EVV1E:error_negative_size_hint

Conversation

@EVV1E

@EVV1E EVV1E commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

The xdg-shell protocol states that the width and height for xdg_toplevel::set_min_size and xdg_toplevel::set_max_size must be greater than or equal to zero and attempting to set negative width/height values should raise an invalid_size error.

Previously, smithay would not post an invalid_size error for such cases.

Additionally, because the toplevel handler converts these values into a smithay::utils::Size, this would trigger an abort due to the debug_assert for negative sizes on Size::new for debug builds.

Checklist

The xdg-shell protocol states that the width and height for
xdg_toplevel::set_min_size and xdg_toplevel::set_max_size must be
greater than or equal to zero and attempting to set negative
width/height values should raise an invalid_size error.

Previously, smithay would not post an invalid_size error for such cases.

Additionally, because the toplevel handler converts these values into a
smithay::utils::Size, this would trigger an abort due to the
debug_assert for negative sizes on Size::new for debug builds.
@EVV1E
EVV1E force-pushed the error_negative_size_hint branch from d6c84f4 to 803ead1 Compare September 28, 2026 15:56
@EVV1E

EVV1E commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

I forgot to add a CHANGELOG.md entry up until now

@Drakulix Drakulix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@Drakulix
Drakulix merged commit bc21b82 into Smithay:master Sep 29, 2026
14 checks passed
@EVV1E
EVV1E deleted the error_negative_size_hint branch September 29, 2026 13:22
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