aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/rootston/cursor.h18
-rw-r--r--include/rootston/desktop.h4
-rw-r--r--include/rootston/seat.h33
-rw-r--r--include/rootston/view.h8
-rw-r--r--include/wlr/types/wlr_data_device.h27
-rw-r--r--include/wlr/types/wlr_seat.h9
6 files changed, 53 insertions, 46 deletions
diff --git a/include/rootston/cursor.h b/include/rootston/cursor.h
index f0c9be89..e2a371bf 100644
--- a/include/rootston/cursor.h
+++ b/include/rootston/cursor.h
@@ -53,12 +53,6 @@ struct roots_cursor {
struct wl_listener tool_axis;
struct wl_listener tool_tip;
- struct wl_listener pointer_grab_begin;
- struct wl_listener pointer_grab_end;
-
- struct wl_listener touch_grab_begin;
- struct wl_listener touch_grab_end;
-
struct wl_listener request_set_cursor;
};
@@ -96,16 +90,4 @@ void roots_cursor_handle_tool_tip(struct roots_cursor *cursor,
void roots_cursor_handle_request_set_cursor(struct roots_cursor *cursor,
struct wlr_seat_pointer_request_set_cursor_event *event);
-void roots_cursor_handle_pointer_grab_begin(struct roots_cursor *cursor,
- struct wlr_seat_pointer_grab *grab);
-
-void roots_cursor_handle_pointer_grab_end(struct roots_cursor *cursor,
- struct wlr_seat_pointer_grab *grab);
-
-void roots_cursor_handle_touch_grab_begin(struct roots_cursor *cursor,
- struct wlr_seat_touch_grab *grab);
-
-void roots_cursor_handle_touch_grab_end(struct roots_cursor *cursor,
- struct wlr_seat_touch_grab *grab);
-
#endif
diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h
index b809db43..c245eb09 100644
--- a/include/rootston/desktop.h
+++ b/include/rootston/desktop.h
@@ -23,7 +23,7 @@ struct roots_output {
};
struct roots_desktop {
- struct wlr_list *views;
+ struct wl_list views; // roots_view::link
struct wl_list outputs;
struct timespec last_frame;
@@ -50,6 +50,7 @@ struct roots_desktop {
#ifdef HAS_XWAYLAND
struct wlr_xwayland *xwayland;
struct wl_listener xwayland_surface;
+ struct wl_listener xwayland_ready;
#endif
};
@@ -59,6 +60,7 @@ struct roots_desktop *desktop_create(struct roots_server *server,
struct roots_config *config);
void desktop_destroy(struct roots_desktop *desktop);
+void view_init(struct roots_view *view, struct roots_desktop *desktop);
void view_destroy(struct roots_view *view);
struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly,
struct wlr_surface **surface, double *sx, double *sy);
diff --git a/include/rootston/seat.h b/include/rootston/seat.h
index aebd4399..7822bb70 100644
--- a/include/rootston/seat.h
+++ b/include/rootston/seat.h
@@ -4,33 +4,18 @@
#include "rootston/input.h"
#include "rootston/keyboard.h"
-struct roots_drag_icon {
- struct wlr_surface *surface;
- struct wl_list link; // roots_seat::drag_icons
- bool mapped;
-
- bool is_pointer;
- int32_t touch_id;
-
- int32_t sx;
- int32_t sy;
-
- struct wl_listener surface_destroy;
- struct wl_listener surface_commit;
-};
-
struct roots_seat {
struct roots_input *input;
struct wlr_seat *seat;
struct roots_cursor *cursor;
struct wl_list link;
- struct wl_list drag_icons;
// coordinates of the first touch point if it exists
int32_t touch_id;
double touch_x, touch_y;
- struct roots_view *focus;
+ struct wl_list views; // roots_seat_view::link
+ bool has_focus;
struct wl_list keyboards;
struct wl_list pointers;
@@ -38,6 +23,14 @@ struct roots_seat {
struct wl_list tablet_tools;
};
+struct roots_seat_view {
+ struct roots_seat *seat;
+ struct roots_view *view;
+ struct wl_list link; // roots_seat::views
+
+ struct wl_listener view_destroy;
+};
+
struct roots_pointer {
struct roots_seat *seat;
struct wlr_input_device *device;
@@ -76,7 +69,11 @@ void roots_seat_configure_xcursor(struct roots_seat *seat);
bool roots_seat_has_meta_pressed(struct roots_seat *seat);
-void roots_seat_focus_view(struct roots_seat *seat, struct roots_view *view);
+struct roots_view *roots_seat_get_focus(struct roots_seat *seat);
+
+void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view);
+
+void roots_seat_cycle_focus(struct roots_seat *seat);
void roots_seat_begin_move(struct roots_seat *seat, struct roots_view *view);
diff --git a/include/rootston/view.h b/include/rootston/view.h
index 99b4ed78..69034d60 100644
--- a/include/rootston/view.h
+++ b/include/rootston/view.h
@@ -9,7 +9,6 @@
struct roots_wl_shell_surface {
struct roots_view *view;
- // TODO: Maybe destroy listener should go in roots_view
struct wl_listener destroy;
struct wl_listener request_move;
struct wl_listener request_resize;
@@ -22,7 +21,6 @@ struct roots_wl_shell_surface {
struct roots_xdg_surface_v6 {
struct roots_view *view;
- // TODO: Maybe destroy listener should go in roots_view
struct wl_listener commit;
struct wl_listener destroy;
struct wl_listener request_move;
@@ -33,7 +31,6 @@ struct roots_xdg_surface_v6 {
struct roots_xwayland_surface {
struct roots_view *view;
- // TODO: Maybe destroy listener should go in roots_view
struct wl_listener destroy;
struct wl_listener request_configure;
struct wl_listener request_move;
@@ -51,6 +48,7 @@ enum roots_view_type {
struct roots_view {
struct roots_desktop *desktop;
+ struct wl_list link; // roots_desktop::views
double x, y;
float rotation;
@@ -80,6 +78,10 @@ struct roots_view {
};
struct wlr_surface *wlr_surface;
+ struct {
+ struct wl_signal destroy;
+ } events;
+
// TODO: This would probably be better as a field that's updated on a
// configure event from the xdg_shell
// If not then this should follow the typical type/impl pattern we use
diff --git a/include/wlr/types/wlr_data_device.h b/include/wlr/types/wlr_data_device.h
index 189ab59b..12b25e45 100644
--- a/include/wlr/types/wlr_data_device.h
+++ b/include/wlr/types/wlr_data_device.h
@@ -53,6 +53,27 @@ struct wlr_data_source {
} events;
};
+struct wlr_drag_icon {
+ struct wlr_surface *surface;
+ struct wlr_seat_client *client;
+ struct wl_list link; // wlr_seat::drag_icons
+ bool mapped;
+
+ bool is_pointer;
+ int32_t touch_id;
+
+ int32_t sx;
+ int32_t sy;
+
+ struct {
+ struct wl_signal destroy;
+ } events;
+
+ struct wl_listener surface_destroy;
+ struct wl_listener surface_commit;
+ struct wl_listener seat_client_destroy;
+};
+
struct wlr_drag {
struct wlr_seat_pointer_grab pointer_grab;
struct wlr_seat_keyboard_grab keyboard_grab;
@@ -64,7 +85,7 @@ struct wlr_drag {
bool is_pointer_grab;
- struct wlr_surface *icon;
+ struct wlr_drag_icon *icon;
struct wlr_surface *focus;
struct wlr_data_source *source;
@@ -72,9 +93,9 @@ struct wlr_drag {
int32_t grab_touch_id;
struct wl_listener point_destroy;
- struct wl_listener icon_destroy;
struct wl_listener source_destroy;
- struct wl_listener seat_client_unbound;
+ struct wl_listener seat_client_destroy;
+ struct wl_listener icon_destroy;
};
/**
diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h
index dbd03401..6d59315b 100644
--- a/include/wlr/types/wlr_seat.h
+++ b/include/wlr/types/wlr_seat.h
@@ -21,6 +21,10 @@ struct wlr_seat_client {
struct wl_resource *touch;
struct wl_resource *data_device;
+ struct {
+ struct wl_signal destroy;
+ } events;
+
struct wl_list link;
};
@@ -165,6 +169,8 @@ struct wlr_seat {
struct wl_global *wl_global;
struct wl_display *display;
struct wl_list clients;
+ struct wl_list drag_icons; // wlr_drag_icon::link
+
char *name;
uint32_t capabilities;
struct timespec last_event;
@@ -180,9 +186,6 @@ struct wlr_seat {
struct wl_listener selection_data_source_destroy;
struct {
- struct wl_signal client_bound;
- struct wl_signal client_unbound;
-
struct wl_signal pointer_grab_begin;
struct wl_signal pointer_grab_end;