aboutsummaryrefslogtreecommitdiff
path: root/rootston/xdg_shell_v6.c
diff options
context:
space:
mode:
Diffstat (limited to 'rootston/xdg_shell_v6.c')
-rw-r--r--rootston/xdg_shell_v6.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c
index 4a809930..e8edaa8f 100644
--- a/rootston/xdg_shell_v6.c
+++ b/rootston/xdg_shell_v6.c
@@ -30,24 +30,11 @@ static void handle_request_move(struct wl_listener *listener, void *data) {
struct roots_view *view = roots_xdg_surface->view;
struct roots_input *input = view->desktop->server->input;
struct wlr_xdg_toplevel_v6_move_event *e = data;
-
- // TODO: Some of this might want to live in cursor.c I guess
- struct roots_input_event *event = NULL;
- size_t len = sizeof(input->input_events) / sizeof(*input->input_events);
- for (size_t i = 0; i < len; ++i) {
- if (input->input_events[i].cursor
- && input->input_events[i].serial == e->serial) {
- event = &input->input_events[i];
- break;
- }
- }
+ const struct roots_input_event *event = get_input_event(input, e->serial);
if (!event || input->mode != ROOTS_CURSOR_PASSTHROUGH) {
return;
}
- input->mode = ROOTS_CURSOR_MOVE;
- input->offs_x = input->cursor->x - view->x;
- input->offs_y = input->cursor->y - view->y;
- wlr_seat_pointer_clear_focus(input->wl_seat);
+ view_begin_move(input, event->cursor, view);
}
static void handle_destroy(struct wl_listener *listener, void *data) {
@@ -96,5 +83,5 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
view->activate = activate;
view->desktop = desktop;
roots_surface->view = view;
- wl_list_insert(&desktop->views, &view->link);
+ list_add(desktop->views, view);
}