From e54038497d1aaa61050a04ef274219da5ca41988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20Krezovi=C4=87?= Date: Fri, 5 Aug 2016 15:28:29 +0200 Subject: [PATCH] compositor: Mark all views as dirty when a new output is assigned MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ć [Pekka: addes commit msg paragrapha 2 and 3.] Reviewed-by: Pekka Paalanen Reviewed-by: Quentin Glidic --- libweston/compositor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libweston/compositor.c b/libweston/compositor.c index b17c76d9..783ff7e5 100644 --- a/libweston/compositor.c +++ b/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