int x_offset, y_offset;
const char *mime_type;
+ struct wl_surface *drag_surface;
struct wl_data_source *data_source;
};
surface = dnd_drag->translucent;
buffer = display_get_buffer_for_surface(dnd->display, surface);
- wl_data_device_attach(device, dnd_drag->time, buffer,
- dnd_drag->hotspot_x, dnd_drag->hotspot_y);
+ wl_surface_attach(dnd_drag->drag_surface, buffer, 0, 0);
}
static void
/* Destroy the item that has been dragged out */
cairo_surface_destroy(dnd_drag->item->surface);
free(dnd_drag->item);
-
+
+ wl_surface_destroy(dnd_drag->drag_surface);
+
cairo_surface_destroy(dnd_drag->translucent);
cairo_surface_destroy(dnd_drag->opaque);
free(dnd_drag);
struct item *item;
struct rectangle allocation;
struct dnd_drag *dnd_drag;
+ struct display *display;
+ struct wl_compositor *compositor;
+ struct wl_buffer *buffer;
int i;
widget_get_allocation(dnd->widget, &allocation);
}
}
+ display = window_get_display(dnd->window);
+ compositor = display_get_compositor(display);
+ dnd_drag->drag_surface =
+ wl_compositor_create_surface(compositor);
+
dnd_drag->data_source =
display_create_data_source(dnd->display);
wl_data_source_add_listener(dnd_drag->data_source,
wl_data_device_start_drag(input_get_data_device(input),
dnd_drag->data_source,
window_get_wl_surface(dnd->window),
+ dnd_drag->drag_surface,
time);
input_set_pointer_image(input, time, POINTER_DRAGGING);
dnd_drag->translucent =
create_drag_cursor(dnd_drag, item, x, y, 0.2);
+ buffer = display_get_buffer_for_surface(dnd->display, dnd_drag->translucent);
+ wl_surface_attach(dnd_drag->drag_surface, buffer,
+ -dnd_drag->hotspot_x, -dnd_drag->hotspot_y);
+
window_schedule_redraw(dnd->window);
}
}