Use the wlroots scene-graph API

References: https://github.com/swaywm/wlroots/pull/1966
This commit is contained in:
Simon Ser 2021-08-09 20:06:57 +02:00 committed by Jente Hidskes
parent 395189fb05
commit f544483340
11 changed files with 61 additions and 149 deletions

9
seat.c
View file

@ -18,6 +18,7 @@
#include <wlr/types/wlr_idle.h>
#include <wlr/types/wlr_keyboard_group.h>
#include <wlr/types/wlr_primary_selection.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_surface.h>
#include <wlr/types/wlr_touch.h>
@ -632,6 +633,8 @@ drag_icon_update_position(struct cg_drag_icon *drag_icon)
}
drag_icon_damage(drag_icon);
wlr_scene_node_set_position(&drag_icon->scene_surface->node, drag_icon->lx, drag_icon->ly);
}
static void
@ -642,6 +645,7 @@ handle_drag_icon_destroy(struct wl_listener *listener, void *data)
drag_icon_damage(drag_icon);
wl_list_remove(&drag_icon->link);
wl_list_remove(&drag_icon->destroy.link);
wlr_scene_node_destroy(&drag_icon->scene_surface->node);
free(drag_icon);
}
@ -684,6 +688,11 @@ handle_start_drag(struct wl_listener *listener, void *data)
}
drag_icon->seat = seat;
drag_icon->wlr_drag_icon = wlr_drag_icon;
drag_icon->scene_surface = wlr_scene_surface_create(&seat->server->scene->node, wlr_drag_icon->surface);
if (!drag_icon->scene_surface) {
free(drag_icon);
return;
}
drag_icon->destroy.notify = handle_drag_icon_destroy;
wl_signal_add(&wlr_drag_icon->events.destroy, &drag_icon->destroy);