diff options
author | 2024-01-18 10:04:51 -0500 | |
---|---|---|
committer | 2024-01-18 18:36:54 +0300 | |
commit | 188811f80861caacd016b857b0d07f6d2d62d15a (patch) | |
tree | dc68ea00b707b25ce398c71fe1ad996f0eb820ea /include | |
parent | input: Query scene graph for relevant surface/node intersections (diff) | |
download | sway-188811f80861caacd016b857b0d07f6d2d62d15a.tar.gz sway-188811f80861caacd016b857b0d07f6d2d62d15a.tar.zst sway-188811f80861caacd016b857b0d07f6d2d62d15a.zip |
scene_graph: Port layer_shell
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/layers.h | 44 | ||||
-rw-r--r-- | include/sway/output.h | 19 | ||||
-rw-r--r-- | include/sway/scene_descriptor.h | 1 | ||||
-rw-r--r-- | include/sway/tree/root.h | 5 |
4 files changed, 19 insertions, 50 deletions
diff --git a/include/sway/layers.h b/include/sway/layers.h index 9220bdb5..a7afb900 100644 --- a/include/sway/layers.h +++ b/include/sway/layers.h | |||
@@ -4,53 +4,30 @@ | |||
4 | #include <wlr/types/wlr_compositor.h> | 4 | #include <wlr/types/wlr_compositor.h> |
5 | #include <wlr/types/wlr_layer_shell_v1.h> | 5 | #include <wlr/types/wlr_layer_shell_v1.h> |
6 | 6 | ||
7 | enum layer_parent { | ||
8 | LAYER_PARENT_LAYER, | ||
9 | LAYER_PARENT_POPUP, | ||
10 | }; | ||
11 | |||
12 | struct sway_layer_surface { | 7 | struct sway_layer_surface { |
13 | struct wlr_layer_surface_v1 *layer_surface; | ||
14 | struct wl_list link; | ||
15 | |||
16 | struct wl_listener destroy; | ||
17 | struct wl_listener map; | 8 | struct wl_listener map; |
18 | struct wl_listener unmap; | 9 | struct wl_listener unmap; |
19 | struct wl_listener surface_commit; | 10 | struct wl_listener surface_commit; |
20 | struct wl_listener output_destroy; | 11 | struct wl_listener output_destroy; |
12 | struct wl_listener node_destroy; | ||
21 | struct wl_listener new_popup; | 13 | struct wl_listener new_popup; |
22 | struct wl_listener new_subsurface; | ||
23 | 14 | ||
24 | struct wlr_box geo; | ||
25 | bool mapped; | 15 | bool mapped; |
26 | struct wlr_box extent; | ||
27 | enum zwlr_layer_shell_v1_layer layer; | ||
28 | 16 | ||
29 | struct wl_list subsurfaces; | 17 | struct sway_output *output; |
18 | struct wlr_scene_layer_surface_v1 *scene; | ||
19 | struct wlr_scene_tree *tree; | ||
20 | struct wlr_scene_tree *popups; | ||
21 | struct wlr_layer_surface_v1 *layer_surface; | ||
30 | }; | 22 | }; |
31 | 23 | ||
32 | struct sway_layer_popup { | 24 | struct sway_layer_popup { |
33 | struct wlr_xdg_popup *wlr_popup; | 25 | struct wlr_xdg_popup *wlr_popup; |
34 | enum layer_parent parent_type; | 26 | struct wlr_scene_tree *scene; |
35 | union { | 27 | struct sway_layer_surface *toplevel; |
36 | struct sway_layer_surface *parent_layer; | ||
37 | struct sway_layer_popup *parent_popup; | ||
38 | }; | ||
39 | struct wl_listener map; | ||
40 | struct wl_listener unmap; | ||
41 | struct wl_listener destroy; | ||
42 | struct wl_listener commit; | ||
43 | struct wl_listener new_popup; | ||
44 | }; | ||
45 | |||
46 | struct sway_layer_subsurface { | ||
47 | struct wlr_subsurface *wlr_subsurface; | ||
48 | struct sway_layer_surface *layer_surface; | ||
49 | struct wl_list link; | ||
50 | 28 | ||
51 | struct wl_listener map; | ||
52 | struct wl_listener unmap; | ||
53 | struct wl_listener destroy; | 29 | struct wl_listener destroy; |
30 | struct wl_listener new_popup; | ||
54 | struct wl_listener commit; | 31 | struct wl_listener commit; |
55 | }; | 32 | }; |
56 | 33 | ||
@@ -61,7 +38,4 @@ struct wlr_layer_surface_v1 *toplevel_layer_surface_from_surface( | |||
61 | 38 | ||
62 | void arrange_layers(struct sway_output *output); | 39 | void arrange_layers(struct sway_output *output); |
63 | 40 | ||
64 | struct sway_layer_surface *layer_from_wlr_layer_surface_v1( | ||
65 | struct wlr_layer_surface_v1 *layer_surface); | ||
66 | |||
67 | #endif | 41 | #endif |
diff --git a/include/sway/output.h b/include/sway/output.h index d353ce61..ea5d8f47 100644 --- a/include/sway/output.h +++ b/include/sway/output.h | |||
@@ -22,8 +22,12 @@ struct sway_output { | |||
22 | struct sway_node node; | 22 | struct sway_node node; |
23 | 23 | ||
24 | struct { | 24 | struct { |
25 | struct wlr_scene_tree *shell_background; | ||
26 | struct wlr_scene_tree *shell_bottom; | ||
25 | struct wlr_scene_tree *tiling; | 27 | struct wlr_scene_tree *tiling; |
26 | struct wlr_scene_tree *fullscreen; | 28 | struct wlr_scene_tree *fullscreen; |
29 | struct wlr_scene_tree *shell_top; | ||
30 | struct wlr_scene_tree *shell_overlay; | ||
27 | struct wlr_scene_tree *session_lock; | 31 | struct wlr_scene_tree *session_lock; |
28 | } layers; | 32 | } layers; |
29 | 33 | ||
@@ -39,7 +43,6 @@ struct sway_output { | |||
39 | struct sway_server *server; | 43 | struct sway_server *server; |
40 | struct wl_list link; | 44 | struct wl_list link; |
41 | 45 | ||
42 | struct wl_list shell_layers[4]; // sway_layer_surface::link | ||
43 | struct wlr_box usable_area; | 46 | struct wlr_box usable_area; |
44 | 47 | ||
45 | struct wlr_damage_ring damage_ring; | 48 | struct wlr_damage_ring damage_ring; |
@@ -124,8 +127,6 @@ void output_enable(struct sway_output *output); | |||
124 | 127 | ||
125 | void output_disable(struct sway_output *output); | 128 | void output_disable(struct sway_output *output); |
126 | 129 | ||
127 | bool output_has_opaque_overlay_layer_surface(struct sway_output *output); | ||
128 | |||
129 | struct sway_workspace *output_get_active_workspace(struct sway_output *output); | 130 | struct sway_workspace *output_get_active_workspace(struct sway_output *output); |
130 | 131 | ||
131 | void output_surface_for_each_surface(struct sway_output *output, | 132 | void output_surface_for_each_surface(struct sway_output *output, |
@@ -140,18 +141,6 @@ void output_view_for_each_popup_surface(struct sway_output *output, | |||
140 | struct sway_view *view, sway_surface_iterator_func_t iterator, | 141 | struct sway_view *view, sway_surface_iterator_func_t iterator, |
141 | void *user_data); | 142 | void *user_data); |
142 | 143 | ||
143 | void output_layer_for_each_surface(struct sway_output *output, | ||
144 | struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator, | ||
145 | void *user_data); | ||
146 | |||
147 | void output_layer_for_each_toplevel_surface(struct sway_output *output, | ||
148 | struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator, | ||
149 | void *user_data); | ||
150 | |||
151 | void output_layer_for_each_popup_surface(struct sway_output *output, | ||
152 | struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator, | ||
153 | void *user_data); | ||
154 | |||
155 | #if HAVE_XWAYLAND | 144 | #if HAVE_XWAYLAND |
156 | void output_unmanaged_for_each_surface(struct sway_output *output, | 145 | void output_unmanaged_for_each_surface(struct sway_output *output, |
157 | struct wl_list *unmanaged, sway_surface_iterator_func_t iterator, | 146 | struct wl_list *unmanaged, sway_surface_iterator_func_t iterator, |
diff --git a/include/sway/scene_descriptor.h b/include/sway/scene_descriptor.h index 8af81219..970adaa5 100644 --- a/include/sway/scene_descriptor.h +++ b/include/sway/scene_descriptor.h | |||
@@ -15,6 +15,7 @@ enum sway_scene_descriptor_type { | |||
15 | SWAY_SCENE_DESC_NON_INTERACTIVE, | 15 | SWAY_SCENE_DESC_NON_INTERACTIVE, |
16 | SWAY_SCENE_DESC_CONTAINER, | 16 | SWAY_SCENE_DESC_CONTAINER, |
17 | SWAY_SCENE_DESC_VIEW, | 17 | SWAY_SCENE_DESC_VIEW, |
18 | SWAY_SCENE_DESC_LAYER_SHELL, | ||
18 | SWAY_SCENE_DESC_DRAG_ICON, | 19 | SWAY_SCENE_DESC_DRAG_ICON, |
19 | }; | 20 | }; |
20 | 21 | ||
diff --git a/include/sway/tree/root.h b/include/sway/tree/root.h index 003606aa..2f717bae 100644 --- a/include/sway/tree/root.h +++ b/include/sway/tree/root.h | |||
@@ -40,10 +40,15 @@ struct sway_root { | |||
40 | struct wlr_scene_tree *layer_tree; | 40 | struct wlr_scene_tree *layer_tree; |
41 | 41 | ||
42 | struct { | 42 | struct { |
43 | struct wlr_scene_tree *shell_background; | ||
44 | struct wlr_scene_tree *shell_bottom; | ||
43 | struct wlr_scene_tree *tiling; | 45 | struct wlr_scene_tree *tiling; |
44 | struct wlr_scene_tree *floating; | 46 | struct wlr_scene_tree *floating; |
47 | struct wlr_scene_tree *shell_top; | ||
45 | struct wlr_scene_tree *fullscreen; | 48 | struct wlr_scene_tree *fullscreen; |
46 | struct wlr_scene_tree *fullscreen_global; | 49 | struct wlr_scene_tree *fullscreen_global; |
50 | struct wlr_scene_tree *shell_overlay; | ||
51 | struct wlr_scene_tree *popup; | ||
47 | struct wlr_scene_tree *seat; | 52 | struct wlr_scene_tree *seat; |
48 | struct wlr_scene_tree *session_lock; | 53 | struct wlr_scene_tree *session_lock; |
49 | } layers; | 54 | } layers; |