aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Alexander Orzechowski <alex@ozal.ski>2023-12-06 14:28:59 -0500
committerLibravatar Kirill Primak <vyivel@eclair.cafe>2024-01-18 18:36:54 +0300
commitb38ed8b4792928dca3e1580e8160792ea41e25c4 (patch)
treeb080710c7a3f37de868ff4d5d96e6971f7105675 /include
parenttransaction: ready signals will return success bools (diff)
downloadsway-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.h1
-rw-r--r--include/sway/tree/view.h46
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
194struct sway_view_child;
195
196struct 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 */
204struct 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
222struct sway_subsurface {
223 struct sway_view_child child;
224
225 struct wl_listener destroy;
226};
227 192
228struct sway_xdg_popup { 193struct 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);
339void view_update_size(struct sway_view *view); 306void view_update_size(struct sway_view *view);
340void view_center_surface(struct sway_view *view); 307void view_center_surface(struct sway_view *view);
341 308
342void 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
346void view_child_destroy(struct sway_view_child *child);
347
348
349struct sway_view *view_from_wlr_xdg_surface( 309struct 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