Enabled is orthogonal from connected. A connected head could be
disabled, or a disconnected head could in the future be enabled.
Compositors quite likely want to check if a head is already enabled
before starting to take it into use.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
return head->connected;
}
+/** Is the head currently enabled?
+ *
+ * \param head The head to query.
+ * \return Video status.
+ *
+ * Returns true if the head is currently transmitting a video stream.
+ *
+ * This is independent of the head being connected.
+ *
+ * \sa weston_head_is_connected
+ * \memberof weston_head
+ */
+WL_EXPORT bool
+weston_head_is_enabled(struct weston_head *head)
+{
+ if (!head->output)
+ return false;
+
+ return head->output->enabled;
+}
+
/* Move other outputs when one is resized so the space remains contiguous. */
static void
weston_compositor_reflow_outputs(struct weston_compositor *compositor,
bool
weston_head_is_connected(struct weston_head *head);
+bool
+weston_head_is_enabled(struct weston_head *head);
+
void
weston_output_set_scale(struct weston_output *output,
int32_t scale);