mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
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:
parent
f4c9d1ba9f
commit
c033667716
5 changed files with 34 additions and 29 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue