mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-29 05:40:19 -04:00
desktop/view: fix segfault in damage_surface_iterator
This function can get called on a surface that is not actually a view. We need the view for the output, but we can pass that as user_data instead when the iterator gets called for all surfaces in a view.
This commit is contained in:
parent
8c1028e2de
commit
f5a7ab0167
1 changed files with 3 additions and 3 deletions
|
|
@ -68,8 +68,8 @@ cage_view_position(struct cg_view *view)
|
||||||
static void
|
static void
|
||||||
damage_surface_iterator(struct wlr_surface *surface, int sx, int sy, void *user_data)
|
damage_surface_iterator(struct wlr_surface *surface, int sx, int sy, void *user_data)
|
||||||
{
|
{
|
||||||
struct cg_view *view = (struct cg_view *) surface->data;
|
struct cg_output *output = (struct cg_output *) user_data;
|
||||||
cage_output_damage_surface(view->output, surface, sx, sy);
|
cage_output_damage_surface(output, surface, sx, sy);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -109,7 +109,7 @@ void
|
||||||
cage_view_damage_part(struct cg_view *view)
|
cage_view_damage_part(struct cg_view *view)
|
||||||
{
|
{
|
||||||
assert(view != NULL);
|
assert(view != NULL);
|
||||||
cage_view_for_each_surface(view, damage_surface_iterator, NULL);
|
cage_view_for_each_surface(view, damage_surface_iterator, (void *) view->output);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_surface *
|
struct wlr_surface *
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue