DragIcon: set position on creation

Currently if a drag icon is created but the cursor/touch point is not
moved river will render the drag icon at 0,0 instead of the cursor/touch
point location. This fixes that.
This commit is contained in:
Isaac Freund
2023-10-25 22:01:05 +02:00
parent 3fb229a71d
commit 4cb65f9e2e
3 changed files with 27 additions and 20 deletions

View File

@ -555,7 +555,7 @@ 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| {
DragIcon.create(wlr_drag_icon) catch {
DragIcon.create(wlr_drag_icon, &self.cursor) catch {
log.err("out of memory", .{});
wlr_drag.seat_client.client.postNoMemory();
return;