diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2023-11-21 19:55:47 -0500 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2024-01-18 18:36:54 +0300 |
commit | c640c3015f3a7ea2987bd7854d13ff282f90804f (patch) | |
tree | d292934709dcd71bdb244546b1684e690e0511f4 /include | |
parent | renderer: Render scene_graph (diff) | |
download | sway-c640c3015f3a7ea2987bd7854d13ff282f90804f.tar.gz sway-c640c3015f3a7ea2987bd7854d13ff282f90804f.tar.zst sway-c640c3015f3a7ea2987bd7854d13ff282f90804f.zip |
scene_graph: Port seat drag icons
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/input/seat.h | 26 | ||||
-rw-r--r-- | include/sway/output.h | 4 | ||||
-rw-r--r-- | include/sway/scene_descriptor.h | 1 | ||||
-rw-r--r-- | include/sway/tree/root.h | 2 |
4 files changed, 13 insertions, 20 deletions
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index 28a3ea37..3c81a713 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h> | 4 | #include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h> |
5 | #include <wlr/types/wlr_layer_shell_v1.h> | 5 | #include <wlr/types/wlr_layer_shell_v1.h> |
6 | #include <wlr/types/wlr_scene.h> | ||
6 | #include <wlr/types/wlr_seat.h> | 7 | #include <wlr/types/wlr_seat.h> |
7 | #include <wlr/types/wlr_touch.h> | 8 | #include <wlr/types/wlr_touch.h> |
8 | #include <wlr/util/edges.h> | 9 | #include <wlr/util/edges.h> |
@@ -75,20 +76,6 @@ struct sway_seat_node { | |||
75 | struct wl_listener destroy; | 76 | struct wl_listener destroy; |
76 | }; | 77 | }; |
77 | 78 | ||
78 | struct sway_drag_icon { | ||
79 | struct sway_seat *seat; | ||
80 | struct wlr_drag_icon *wlr_drag_icon; | ||
81 | struct wl_list link; // sway_root::drag_icons | ||
82 | |||
83 | double x, y; // in layout-local coordinates | ||
84 | int dx, dy; // offset in surface-local coordinates | ||
85 | |||
86 | struct wl_listener surface_commit; | ||
87 | struct wl_listener map; | ||
88 | struct wl_listener unmap; | ||
89 | struct wl_listener destroy; | ||
90 | }; | ||
91 | |||
92 | struct sway_drag { | 79 | struct sway_drag { |
93 | struct sway_seat *seat; | 80 | struct sway_seat *seat; |
94 | struct wlr_drag *wlr_drag; | 81 | struct wlr_drag *wlr_drag; |
@@ -99,6 +86,15 @@ struct sway_seat { | |||
99 | struct wlr_seat *wlr_seat; | 86 | struct wlr_seat *wlr_seat; |
100 | struct sway_cursor *cursor; | 87 | struct sway_cursor *cursor; |
101 | 88 | ||
89 | // Seat scene tree structure | ||
90 | // - scene_tree | ||
91 | // - drag icons | ||
92 | // - drag icon 1 | ||
93 | // - drag icon 2 | ||
94 | // - seatop specific stuff | ||
95 | struct wlr_scene_tree *scene_tree; | ||
96 | struct wlr_scene_tree *drag_icons; | ||
97 | |||
102 | bool has_focus; | 98 | bool has_focus; |
103 | struct wl_list focus_stack; // list of containers in focus order | 99 | struct wl_list focus_stack; // list of containers in focus order |
104 | struct sway_workspace *workspace; | 100 | struct sway_workspace *workspace; |
@@ -257,7 +253,7 @@ void seat_idle_notify_activity(struct sway_seat *seat, | |||
257 | 253 | ||
258 | bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface); | 254 | bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface); |
259 | 255 | ||
260 | void drag_icon_update_position(struct sway_drag_icon *icon); | 256 | void drag_icons_update_position(struct sway_seat *seat); |
261 | 257 | ||
262 | enum wlr_edges find_resize_edge(struct sway_container *cont, | 258 | enum wlr_edges find_resize_edge(struct sway_container *cont, |
263 | struct wlr_surface *surface, struct sway_cursor *cursor); | 259 | struct wlr_surface *surface, struct sway_cursor *cursor); |
diff --git a/include/sway/output.h b/include/sway/output.h index b35f1366..28240819 100644 --- a/include/sway/output.h +++ b/include/sway/output.h | |||
@@ -167,10 +167,6 @@ void output_unmanaged_for_each_surface(struct sway_output *output, | |||
167 | void *user_data); | 167 | void *user_data); |
168 | #endif | 168 | #endif |
169 | 169 | ||
170 | void output_drag_icons_for_each_surface(struct sway_output *output, | ||
171 | struct wl_list *drag_icons, sway_surface_iterator_func_t iterator, | ||
172 | void *user_data); | ||
173 | |||
174 | void output_for_each_workspace(struct sway_output *output, | 170 | void output_for_each_workspace(struct sway_output *output, |
175 | void (*f)(struct sway_workspace *ws, void *data), void *data); | 171 | void (*f)(struct sway_workspace *ws, void *data), void *data); |
176 | 172 | ||
diff --git a/include/sway/scene_descriptor.h b/include/sway/scene_descriptor.h index 9761c2c0..057993ec 100644 --- a/include/sway/scene_descriptor.h +++ b/include/sway/scene_descriptor.h | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | enum sway_scene_descriptor_type { | 13 | enum sway_scene_descriptor_type { |
14 | SWAY_SCENE_DESC_BUFFER_TIMER, | 14 | SWAY_SCENE_DESC_BUFFER_TIMER, |
15 | SWAY_SCENE_DESC_DRAG_ICON, | ||
15 | }; | 16 | }; |
16 | 17 | ||
17 | bool scene_descriptor_assign(struct wlr_scene_node *node, | 18 | bool scene_descriptor_assign(struct wlr_scene_node *node, |
diff --git a/include/sway/tree/root.h b/include/sway/tree/root.h index 9cb3d7bf..4b48a651 100644 --- a/include/sway/tree/root.h +++ b/include/sway/tree/root.h | |||
@@ -40,12 +40,12 @@ struct sway_root { | |||
40 | struct wlr_scene_tree *floating; | 40 | struct wlr_scene_tree *floating; |
41 | struct wlr_scene_tree *fullscreen; | 41 | struct wlr_scene_tree *fullscreen; |
42 | struct wlr_scene_tree *fullscreen_global; | 42 | struct wlr_scene_tree *fullscreen_global; |
43 | struct wlr_scene_tree *seat; | ||
43 | } layers; | 44 | } layers; |
44 | 45 | ||
45 | #if HAVE_XWAYLAND | 46 | #if HAVE_XWAYLAND |
46 | struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link | 47 | struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link |
47 | #endif | 48 | #endif |
48 | struct wl_list drag_icons; // sway_drag_icon::link | ||
49 | 49 | ||
50 | // Includes disabled outputs | 50 | // Includes disabled outputs |
51 | struct wl_list all_outputs; // sway_output::link | 51 | struct wl_list all_outputs; // sway_output::link |