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.
master
Simon Ser 10 months ago
parent be1c48cbfb
commit b80337a8f2

@ -28,6 +28,7 @@ struct wlr_xdg_popup_configure *send_xdg_popup_configure(
}
struct wlr_box *geometry = &configure->geometry;
assert(geometry->width > 0 && geometry->height > 0);
xdg_popup_send_configure(popup->resource,
geometry->x, geometry->y,
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,
int32_t width, int32_t height) {
assert(width >= 0 && height >= 0);
toplevel->scheduled.width = width;
toplevel->scheduled.height = height;
return wlr_xdg_surface_schedule_configure(toplevel->base);

Loading…
Cancel
Save