aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2022-01-13 11:55:09 +0300
committerSimon Ser <contact@emersion.fr>2022-01-13 10:06:41 +0000
commitb6f43ab2e16931c5604b7e570edf481b3392fd25 (patch)
tree6c2fea127332affac5d467a933b71fa35da6a6ec /include
parent6cdf843a8cef420255e0a55c842530184abb3fe4 (diff)
subcompositor: split out from compositor
Diffstat (limited to 'include')
-rw-r--r--include/wlr/types/wlr_compositor.h15
-rw-r--r--include/wlr/types/wlr_subcompositor.h37
2 files changed, 37 insertions, 15 deletions
diff --git a/include/wlr/types/wlr_compositor.h b/include/wlr/types/wlr_compositor.h
index 04391c74..756f6f30 100644
--- a/include/wlr/types/wlr_compositor.h
+++ b/include/wlr/types/wlr_compositor.h
@@ -14,16 +14,10 @@
struct wlr_surface;
-struct wlr_subcompositor {
- struct wl_global *global;
-};
-
struct wlr_compositor {
struct wl_global *global;
struct wlr_renderer *renderer;
- struct wlr_subcompositor subcompositor;
-
struct wl_listener display_destroy;
struct {
@@ -35,13 +29,4 @@ struct wlr_compositor {
struct wlr_compositor *wlr_compositor_create(struct wl_display *display,
struct wlr_renderer *renderer);
-bool wlr_surface_is_subsurface(struct wlr_surface *surface);
-
-/**
- * Get a subsurface from a surface. Can return NULL if the subsurface has been
- * destroyed.
- */
-struct wlr_subsurface *wlr_subsurface_from_wlr_surface(
- struct wlr_surface *surface);
-
#endif
diff --git a/include/wlr/types/wlr_subcompositor.h b/include/wlr/types/wlr_subcompositor.h
new file mode 100644
index 00000000..f9c887bb
--- /dev/null
+++ b/include/wlr/types/wlr_subcompositor.h
@@ -0,0 +1,37 @@
+/*
+ * This an unstable interface of wlroots. No guarantees are made regarding the
+ * future consistency of this API.
+ */
+#ifndef WLR_USE_UNSTABLE
+#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
+#endif
+
+#ifndef WLR_TYPES_WLR_SUBCOMPOSITOR_H
+#define WLR_TYPES_WLR_SUBCOMPOSITOR_H
+
+#include <wayland-server-core.h>
+
+struct wlr_surface;
+
+struct wlr_subcompositor {
+ struct wl_global *global;
+
+ struct wl_listener display_destroy;
+
+ struct {
+ struct wl_signal destroy;
+ } events;
+};
+
+bool wlr_surface_is_subsurface(struct wlr_surface *surface);
+
+/**
+ * Get a subsurface from a surface. Can return NULL if the subsurface has been
+ * destroyed.
+ */
+struct wlr_subsurface *wlr_subsurface_from_wlr_surface(
+ struct wlr_surface *surface);
+
+struct wlr_subcompositor *wlr_subcompositor_create(struct wl_display *display);
+
+#endif