[PATCH weston v5 25/36] libweston: remove output_pending_signal

Pekka Paalanen ppaalanen at gmail.com
Thu Dec 14 11:41:02 UTC 2017


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

The signal has been replaced with the heads_changed hook and is no
longer useful.

weston_pending_output_coldplug() is renamed to
weston_compositor_flush_heads_changed() for two reasons: it better
describes what it does now, and it serves as an obvious flag that
libweston ABI has been broken.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
 compositor/main.c      |  2 +-
 libweston/compositor.c | 17 +++++------------
 libweston/compositor.h |  3 +--
 3 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/compositor/main.c b/compositor/main.c
index e47d7928..14c77107 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -2056,7 +2056,7 @@ int main(int argc, char *argv[])
 		goto out;
 	}
 
-	weston_pending_output_coldplug(ec);
+	weston_compositor_flush_heads_changed(ec);
 	if (user_data.init_failed)
 		goto out;
 
diff --git a/libweston/compositor.c b/libweston/compositor.c
index 0d3e185b..a8df7e94 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -5408,9 +5408,6 @@ weston_output_init(struct weston_output *output,
  * \param output     The weston_output object to add
  * \param compositor The compositor instance.
  *
- * Also notifies the compositor that an output is pending for
- * configuration.
- *
  * The opposite of this operation is built into weston_output_release().
  *
  * \memberof weston_output
@@ -5425,7 +5422,6 @@ weston_compositor_add_pending_output(struct weston_output *output,
 
 	wl_list_remove(&output->link);
 	wl_list_insert(compositor->pending_output_list.prev, &output->link);
-	wl_signal_emit(&compositor->output_pending_signal, output);
 }
 
 /** Constructs a weston_output object that can be used by the compositor.
@@ -5572,18 +5568,16 @@ weston_output_disable(struct weston_output *output)
 	output->destroying = 0;
 }
 
-/** Emits a signal to indicate that there are outputs waiting to be configured.
+/** Forces a synchronous call to heads_changed hook
  *
  * \param compositor The compositor instance
+ *
+ * If there are new or changed heads, calls the heads_changed hook and
+ * returns after the hook returns.
  */
 WL_EXPORT void
-weston_pending_output_coldplug(struct weston_compositor *compositor)
+weston_compositor_flush_heads_changed(struct weston_compositor *compositor)
 {
-	struct weston_output *output, *next;
-
-	wl_list_for_each_safe(output, next, &compositor->pending_output_list, link)
-		wl_signal_emit(&compositor->output_pending_signal, output);
-
 	if (compositor->heads_changed_source) {
 		wl_event_source_remove(compositor->heads_changed_source);
 		weston_compositor_call_heads_changed(compositor);
@@ -6054,7 +6048,6 @@ weston_compositor_create(struct wl_display *display, void *user_data)
 	wl_signal_init(&ec->hide_input_panel_signal);
 	wl_signal_init(&ec->update_input_panel_signal);
 	wl_signal_init(&ec->seat_created_signal);
-	wl_signal_init(&ec->output_pending_signal);
 	wl_signal_init(&ec->output_created_signal);
 	wl_signal_init(&ec->output_destroyed_signal);
 	wl_signal_init(&ec->output_moved_signal);
diff --git a/libweston/compositor.h b/libweston/compositor.h
index 1a9aac7f..af681e51 100644
--- a/libweston/compositor.h
+++ b/libweston/compositor.h
@@ -952,7 +952,6 @@ struct weston_compositor {
 	struct wl_signal update_input_panel_signal;
 
 	struct wl_signal seat_created_signal;
-	struct wl_signal output_pending_signal;
 	struct wl_signal output_created_signal;
 	struct wl_signal output_destroyed_signal;
 	struct wl_signal output_moved_signal;
@@ -2112,7 +2111,7 @@ void
 weston_output_disable(struct weston_output *output);
 
 void
-weston_pending_output_coldplug(struct weston_compositor *compositor);
+weston_compositor_flush_heads_changed(struct weston_compositor *compositor);
 
 struct weston_head *
 weston_head_from_resource(struct wl_resource *resource);
-- 
2.13.6



More information about the wayland-devel mailing list