src/ssd/: Don't access view->surface->current directly

Instead use view->{w,h} which are set on client commit
This commit is contained in:
Consolatis 2022-02-24 01:27:29 +01:00 committed by Johan Malm
parent f4c9d1ba9f
commit c033667716
5 changed files with 34 additions and 29 deletions

View file

@ -18,6 +18,15 @@ add_scene_rect(struct wl_list *list, enum ssd_part_type type,
struct wlr_scene_node *parent, int width, int height,
int x, int y, float color[4])
{
/*
* When initialized without surface being mapped,
* size may be negative. Just set to 0, next call
* to ssd_*_update() will update the rect to use
* its correct size.
*/
width = width >= 0 ? width : 0;
height = height >= 0 ? height : 0;
struct ssd_part *part = add_scene_part(list, type);
part->node = &wlr_scene_rect_create(
parent, width, height, color)->node;