DragIcon: render using the scene graph

This commit is contained in:
Isaac Freund
2023-02-16 16:54:53 +01:00
parent 0e0b585c44
commit 0b2272ec57
5 changed files with 99 additions and 20 deletions

View File

@ -92,7 +92,6 @@ drag: enum {
pointer,
touch,
} = .none,
drag_icon: ?*DragIcon = null,
request_set_selection: wl.Listener(*wlr.Seat.event.RequestSetSelection) =
wl.Listener(*wlr.Seat.event.RequestSetSelection).init(handleRequestSetSelection),
@ -573,13 +572,11 @@ fn handleStartDrag(listener: *wl.Listener(*wlr.Drag), wlr_drag: *wlr.Drag) void
wlr_drag.events.destroy.add(&self.drag_destroy);
if (wlr_drag.icon) |wlr_drag_icon| {
const drag_icon = util.gpa.create(DragIcon) catch {
DragIcon.create(wlr_drag_icon) catch {
log.err("out of memory", .{});
wlr_drag.seat_client.client.postNoMemory();
return;
};
drag_icon.init(self, wlr_drag_icon);
self.drag_icon = drag_icon;
}
}