compositor: Always assign an output when updating a surface transform
Also make all the callers of weston_surface_assign_output() update the
transform instead. This makes sure that when the surface is assigned an
output its bouding box is valid.
This fixes a bug where a newly created surface would have a NULL output
assigned. This would cause weston_surface_schedule_repaint() to not
schedule a repaint, preventing the surface to be shown until something
else caused a repaint.
diff --git a/src/compositor.c b/src/compositor.c
index bda1381..8c8dff0 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -456,8 +456,7 @@
weston_surface_damage_below(surface);
- if (weston_surface_is_mapped(surface))
- weston_surface_assign_output(surface);
+ weston_surface_assign_output(surface);
}
WL_EXPORT void
@@ -1026,7 +1025,7 @@
weston_surface_set_color(surface, 0.0, 0.0, 0.0, 0.0);
wl_list_insert(&compositor->fade_layer.surface_list,
&surface->layer_link);
- weston_surface_assign_output(surface);
+ weston_surface_update_transform(surface);
compositor->fade.surface = surface;
pixman_region32_init(&surface->input);
}
@@ -1929,7 +1928,7 @@
if (!weston_surface_is_mapped(es)) {
wl_list_insert(&es->compositor->cursor_layer.surface_list,
&es->layer_link);
- weston_surface_assign_output(es);
+ weston_surface_update_transform(es);
}
}
@@ -2416,7 +2415,7 @@
list = &seat->compositor->cursor_layer.surface_list;
wl_list_insert(list, &seat->drag_surface->layer_link);
- weston_surface_assign_output(seat->drag_surface);
+ weston_surface_update_transform(seat->drag_surface);
empty_region(&seat->drag_surface->input);
}