aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-11-21 19:55:47 -0500
committerKirill Primak <vyivel@eclair.cafe>2024-01-18 18:36:54 +0300
commitc640c3015f3a7ea2987bd7854d13ff282f90804f (patch)
treed292934709dcd71bdb244546b1684e690e0511f4 /include
parent9c17cba0b29979ae23c4521b884f7419fd558770 (diff)
scene_graph: Port seat drag icons
Diffstat (limited to 'include')
-rw-r--r--include/sway/input/seat.h26
-rw-r--r--include/sway/output.h4
-rw-r--r--include/sway/scene_descriptor.h1
-rw-r--r--include/sway/tree/root.h2
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 @@
#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h>
#include <wlr/types/wlr_layer_shell_v1.h>
+#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_touch.h>
#include <wlr/util/edges.h>
@@ -75,20 +76,6 @@ struct sway_seat_node {
struct wl_listener destroy;
};
-struct sway_drag_icon {
- struct sway_seat *seat;
- struct wlr_drag_icon *wlr_drag_icon;
- struct wl_list link; // sway_root::drag_icons
-
- double x, y; // in layout-local coordinates
- int dx, dy; // offset in surface-local coordinates
-
- struct wl_listener surface_commit;
- struct wl_listener map;
- struct wl_listener unmap;
- struct wl_listener destroy;
-};
-
struct sway_drag {
struct sway_seat *seat;
struct wlr_drag *wlr_drag;
@@ -99,6 +86,15 @@ struct sway_seat {
struct wlr_seat *wlr_seat;
struct sway_cursor *cursor;
+ // Seat scene tree structure
+ // - scene_tree
+ // - drag icons
+ // - drag icon 1
+ // - drag icon 2
+ // - seatop specific stuff
+ struct wlr_scene_tree *scene_tree;
+ struct wlr_scene_tree *drag_icons;
+
bool has_focus;
struct wl_list focus_stack; // list of containers in focus order
struct sway_workspace *workspace;
@@ -257,7 +253,7 @@ void seat_idle_notify_activity(struct sway_seat *seat,
bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface);
-void drag_icon_update_position(struct sway_drag_icon *icon);
+void drag_icons_update_position(struct sway_seat *seat);
enum wlr_edges find_resize_edge(struct sway_container *cont,
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,
void *user_data);
#endif
-void output_drag_icons_for_each_surface(struct sway_output *output,
- struct wl_list *drag_icons, sway_surface_iterator_func_t iterator,
- void *user_data);
-
void output_for_each_workspace(struct sway_output *output,
void (*f)(struct sway_workspace *ws, void *data), void *data);
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 @@
enum sway_scene_descriptor_type {
SWAY_SCENE_DESC_BUFFER_TIMER,
+ SWAY_SCENE_DESC_DRAG_ICON,
};
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 {
struct wlr_scene_tree *floating;
struct wlr_scene_tree *fullscreen;
struct wlr_scene_tree *fullscreen_global;
+ struct wlr_scene_tree *seat;
} layers;
#if HAVE_XWAYLAND
struct wl_list xwayland_unmanaged; // sway_xwayland_unmanaged::link
#endif
- struct wl_list drag_icons; // sway_drag_icon::link
// Includes disabled outputs
struct wl_list all_outputs; // sway_output::link