Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ additionally drops the buffers cached for copying between a render and a target

### Bugfixes

The `xdg_toplevel` request handler now posts an `invalid_size` error when a client performs a `set_max_size` or `set_min_size` request with a negative width or height.

`DrmDeviceFd::new` no longer tries to become DRM master on a render node, which the kernel always
refuses, so it no longer warns about it.

Expand Down
14 changes: 14 additions & 0 deletions src/wayland/shell/xdg/handlers/surface/toplevel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,25 @@ where
}
}
xdg_toplevel::Request::SetMaxSize { width, height } => {
if width < 0 || height < 0 {
toplevel.post_error(
xdg_toplevel::Error::InvalidSize,
"The max size cannot be negative",
);
return;
}
with_toplevel_pending_state(self, |toplevel_data| {
toplevel_data.max_size = (width, height).into();
});
}
xdg_toplevel::Request::SetMinSize { width, height } => {
if width < 0 || height < 0 {
toplevel.post_error(
xdg_toplevel::Error::InvalidSize,
"The min size cannot be negative",
);
return;
}
with_toplevel_pending_state(self, |toplevel_data| {
toplevel_data.min_size = (width, height).into();
});
Expand Down
Loading