drag-icon: surface committed

This commit is contained in:
Tony Crisci 2017-12-27 06:41:14 -05:00
parent 68328700c7
commit e42d762a88
2 changed files with 6 additions and 8 deletions

View file

@ -72,7 +72,6 @@ struct wlr_drag_icon {
} events; } events;
struct wl_listener surface_destroy; struct wl_listener surface_destroy;
struct wl_listener surface_commit;
struct wl_listener seat_client_destroy; struct wl_listener seat_client_destroy;
}; };

View file

@ -651,7 +651,7 @@ static void wlr_drag_icon_destroy(struct wlr_drag_icon *icon) {
return; return;
} }
wl_signal_emit(&icon->events.destroy, icon); wl_signal_emit(&icon->events.destroy, icon);
wl_list_remove(&icon->surface_commit.link); wlr_surface_set_role_committed(icon->surface, NULL, NULL);
wl_list_remove(&icon->surface_destroy.link); wl_list_remove(&icon->surface_destroy.link);
wl_list_remove(&icon->seat_client_destroy.link); wl_list_remove(&icon->seat_client_destroy.link);
wl_list_remove(&icon->link); wl_list_remove(&icon->link);
@ -665,10 +665,9 @@ static void handle_drag_icon_surface_destroy(struct wl_listener *listener,
wlr_drag_icon_destroy(icon); wlr_drag_icon_destroy(icon);
} }
static void handle_drag_icon_surface_commit(struct wl_listener *listener, static void handle_drag_icon_surface_commit(struct wlr_surface *surface,
void *data) { void *role_data) {
struct wlr_drag_icon *icon = struct wlr_drag_icon *icon = role_data;
wl_container_of(listener, icon, surface_commit);
icon->sx += icon->surface->current->sx; icon->sx += icon->surface->current->sx;
icon->sy += icon->surface->current->sy; icon->sy += icon->surface->current->sy;
} }
@ -701,8 +700,8 @@ static struct wlr_drag_icon *wlr_drag_icon_create(
wl_signal_add(&icon->surface->events.destroy, &icon->surface_destroy); wl_signal_add(&icon->surface->events.destroy, &icon->surface_destroy);
icon->surface_destroy.notify = handle_drag_icon_surface_destroy; icon->surface_destroy.notify = handle_drag_icon_surface_destroy;
wl_signal_add(&icon->surface->events.commit, &icon->surface_commit); wlr_surface_set_role_committed(icon->surface,
icon->surface_commit.notify = handle_drag_icon_surface_commit; handle_drag_icon_surface_commit, icon);
wl_signal_add(&client->events.destroy, &icon->seat_client_destroy); wl_signal_add(&client->events.destroy, &icon->seat_client_destroy);
icon->seat_client_destroy.notify = handle_drag_icon_seat_client_destroy; icon->seat_client_destroy.notify = handle_drag_icon_seat_client_destroy;