diff options
author | 2023-12-06 14:28:59 -0500 | |
---|---|---|
committer | 2024-01-18 18:36:54 +0300 | |
commit | b38ed8b4792928dca3e1580e8160792ea41e25c4 (patch) | |
tree | b080710c7a3f37de868ff4d5d96e6971f7105675 /include | |
parent | transaction: ready signals will return success bools (diff) | |
download | sway-b38ed8b4792928dca3e1580e8160792ea41e25c4.tar.gz sway-b38ed8b4792928dca3e1580e8160792ea41e25c4.tar.zst sway-b38ed8b4792928dca3e1580e8160792ea41e25c4.zip |
scene_graph: Port xdg_shell
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/scene_descriptor.h | 1 | ||||
-rw-r--r-- | include/sway/tree/view.h | 46 |
2 files changed, 4 insertions, 43 deletions
diff --git a/include/sway/scene_descriptor.h b/include/sway/scene_descriptor.h index 970adaa5..43991f77 100644 --- a/include/sway/scene_descriptor.h +++ b/include/sway/scene_descriptor.h | |||
@@ -16,6 +16,7 @@ enum sway_scene_descriptor_type { | |||
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_LAYER_SHELL, |
19 | SWAY_SCENE_DESC_POPUP, | ||
19 | SWAY_SCENE_DESC_DRAG_ICON, | 20 | SWAY_SCENE_DESC_DRAG_ICON, |
20 | }; | 21 | }; |
21 | 22 | ||
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 4aaed9e3..467d912f 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -123,8 +123,6 @@ struct sway_view { | |||
123 | struct wl_signal unmap; | 123 | struct wl_signal unmap; |
124 | } events; | 124 | } events; |
125 | 125 | ||
126 | struct wl_listener surface_new_subsurface; | ||
127 | |||
128 | int max_render_time; // In milliseconds | 126 | int max_render_time; // In milliseconds |
129 | 127 | ||
130 | enum seat_config_shortcuts_inhibit shortcuts_inhibit; | 128 | enum seat_config_shortcuts_inhibit shortcuts_inhibit; |
@@ -191,43 +189,12 @@ struct sway_xwayland_unmanaged { | |||
191 | struct wl_listener override_redirect; | 189 | struct wl_listener override_redirect; |
192 | }; | 190 | }; |
193 | #endif | 191 | #endif |
194 | struct sway_view_child; | ||
195 | |||
196 | struct sway_view_child_impl { | ||
197 | void (*get_view_coords)(struct sway_view_child *child, int *sx, int *sy); | ||
198 | void (*destroy)(struct sway_view_child *child); | ||
199 | }; | ||
200 | |||
201 | /** | ||
202 | * A view child is a surface in the view tree, such as a subsurface or a popup. | ||
203 | */ | ||
204 | struct sway_view_child { | ||
205 | const struct sway_view_child_impl *impl; | ||
206 | struct wl_list link; | ||
207 | |||
208 | struct sway_view *view; | ||
209 | struct sway_view_child *parent; | ||
210 | struct wl_list children; // sway_view_child::link | ||
211 | struct wlr_surface *surface; | ||
212 | bool mapped; | ||
213 | |||
214 | struct wl_listener surface_commit; | ||
215 | struct wl_listener surface_new_subsurface; | ||
216 | struct wl_listener surface_map; | ||
217 | struct wl_listener surface_unmap; | ||
218 | struct wl_listener surface_destroy; | ||
219 | struct wl_listener view_unmap; | ||
220 | }; | ||
221 | |||
222 | struct sway_subsurface { | ||
223 | struct sway_view_child child; | ||
224 | |||
225 | struct wl_listener destroy; | ||
226 | }; | ||
227 | 192 | ||
228 | struct sway_xdg_popup { | 193 | struct sway_xdg_popup { |
229 | struct sway_view_child child; | 194 | struct sway_view *view; |
230 | 195 | ||
196 | struct wlr_scene_tree *scene_tree; | ||
197 | struct wlr_scene_tree *xdg_surface_tree; | ||
231 | struct wlr_xdg_popup *wlr_xdg_popup; | 198 | struct wlr_xdg_popup *wlr_xdg_popup; |
232 | 199 | ||
233 | struct wl_listener surface_commit; | 200 | struct wl_listener surface_commit; |
@@ -339,13 +306,6 @@ void view_unmap(struct sway_view *view); | |||
339 | void view_update_size(struct sway_view *view); | 306 | void view_update_size(struct sway_view *view); |
340 | void view_center_surface(struct sway_view *view); | 307 | void view_center_surface(struct sway_view *view); |
341 | 308 | ||
342 | void view_child_init(struct sway_view_child *child, | ||
343 | const struct sway_view_child_impl *impl, struct sway_view *view, | ||
344 | struct wlr_surface *surface); | ||
345 | |||
346 | void view_child_destroy(struct sway_view_child *child); | ||
347 | |||
348 | |||
349 | struct sway_view *view_from_wlr_xdg_surface( | 309 | struct sway_view *view_from_wlr_xdg_surface( |
350 | struct wlr_xdg_surface *xdg_surface); | 310 | struct wlr_xdg_surface *xdg_surface); |
351 | #if HAVE_XWAYLAND | 311 | #if HAVE_XWAYLAND |