libweston: add weston_head_{is,set}_non_desktop()

Add non-desktop property for weston_heads representing displays that the
desktop should not be extended to by default, e.g. head mounted displays.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
diff --git a/libweston/compositor.c b/libweston/compositor.c
index e099738..c94fa31 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -4939,6 +4939,25 @@
 	weston_head_set_device_changed(head);
 }
 
+/** Store display non-desktop status
+ *
+ * \param head The head to modify.
+ * \param non_desktop Whether the head connects to a non-desktop display.
+ *
+ * \memberof weston_head
+ * \internal
+ */
+WL_EXPORT void
+weston_head_set_non_desktop(struct weston_head *head, bool non_desktop)
+{
+	if (head->non_desktop == non_desktop)
+		return;
+
+	head->non_desktop = non_desktop;
+
+	weston_head_set_device_changed(head);
+}
+
 /** Store physical image size
  *
  * \param head The head to modify.
@@ -5103,6 +5122,22 @@
 	return head->device_changed;
 }
 
+/** Does the head represent a non-desktop display?
+ *
+ * \param head The head to query.
+ * \return True if the device is a non-desktop display.
+ *
+ * Non-desktop heads are not attached to outputs by default.
+ * This stops weston from extending the desktop onto head mounted displays.
+ *
+ * \memberof weston_head
+ */
+WL_EXPORT bool
+weston_head_is_non_desktop(struct weston_head *head)
+{
+	return head->non_desktop;
+}
+
 /** Acknowledge device information change
  *
  * \param head The head to acknowledge.