compositor: Mark all views as dirty when a new output is assigned

When all outputs are gone and views were created before they
were gone, such views would have no output object assigned and
nothing would assign it later. This makes sure all views are
set as dirty, so they can get an output assigned when an
output gets plugged in, if they didn't have any output assigned.

This change also works when a new output is added even if there already
are outputs in use. A view may be partly off-screen. If the new output
appears at a position where it overlaps an existing view, that view
should get updated.

It is enough to process only the main view_list, because views not on
that list are not shown for the moment and so do not need an immediate
update. Instead, they will get updated later as needed because making an
off-list view to go on-list inherently requires calling
weston_view_geometry_dirty().

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
[Pekka: addes commit msg paragrapha 2 and 3.]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
dev
Armin Krezović 9 years ago committed by Pekka Paalanen
parent 545dba6fda
commit e54038497d
  1. 5
      libweston/compositor.c

@ -4326,8 +4326,13 @@ WL_EXPORT void
weston_compositor_add_output(struct weston_compositor *compositor,
struct weston_output *output)
{
struct weston_view *view, *next;
wl_list_insert(compositor->output_list.prev, &output->link);
wl_signal_emit(&compositor->output_created_signal, output);
wl_list_for_each_safe(view, next, &compositor->view_list, link)
weston_view_geometry_dirty(view);
}
WL_EXPORT void

Loading…
Cancel
Save