fix: crash when clipbox width or height less than zero

This commit is contained in:
DreamMaoMao 2025-03-21 10:36:28 +08:00
parent 28bbe5b225
commit d86301d713

View file

@ -1025,6 +1025,9 @@ void apply_border(Client *c, struct wlr_box clip_box, int offsetx,
if (c->iskilling || !client_surface(c)->mapped) if (c->iskilling || !client_surface(c)->mapped)
return; return;
if(clip_box.width < 0 || clip_box.height < 0)
return;
wlr_scene_node_set_position(&c->scene_surface->node, c->bw, c->bw); wlr_scene_node_set_position(&c->scene_surface->node, c->bw, c->bw);
wlr_scene_rect_set_size(c->border[0], clip_box.width, c->bw); wlr_scene_rect_set_size(c->border[0], clip_box.width, c->bw);
wlr_scene_rect_set_size(c->border[1], clip_box.width, c->bw); wlr_scene_rect_set_size(c->border[1], clip_box.width, c->bw);