mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
xdg-shell: assert that configure events carry positive or zero sizes
Negative values here would indicate a compositor bug. For xdg_popup, zero values are not allowed.
This commit is contained in:
parent
be1c48cbfb
commit
b80337a8f2
2 changed files with 2 additions and 0 deletions
|
@ -28,6 +28,7 @@ struct wlr_xdg_popup_configure *send_xdg_popup_configure(
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_box *geometry = &configure->geometry;
|
struct wlr_box *geometry = &configure->geometry;
|
||||||
|
assert(geometry->width > 0 && geometry->height > 0);
|
||||||
xdg_popup_send_configure(popup->resource,
|
xdg_popup_send_configure(popup->resource,
|
||||||
geometry->x, geometry->y,
|
geometry->x, geometry->y,
|
||||||
geometry->width, geometry->height);
|
geometry->width, geometry->height);
|
||||||
|
|
|
@ -556,6 +556,7 @@ void wlr_xdg_toplevel_send_close(struct wlr_xdg_toplevel *toplevel) {
|
||||||
|
|
||||||
uint32_t wlr_xdg_toplevel_set_size(struct wlr_xdg_toplevel *toplevel,
|
uint32_t wlr_xdg_toplevel_set_size(struct wlr_xdg_toplevel *toplevel,
|
||||||
int32_t width, int32_t height) {
|
int32_t width, int32_t height) {
|
||||||
|
assert(width >= 0 && height >= 0);
|
||||||
toplevel->scheduled.width = width;
|
toplevel->scheduled.width = width;
|
||||||
toplevel->scheduled.height = height;
|
toplevel->scheduled.height = height;
|
||||||
return wlr_xdg_surface_schedule_configure(toplevel->base);
|
return wlr_xdg_surface_schedule_configure(toplevel->base);
|
||||||
|
|
Loading…
Reference in a new issue