Use it to detect local drags when creating drop objects.
GdkClipboard *clipboard;
GdkClipboard *primary_clipboard;
struct wl_data_device *data_device;
+ GdkDragContext *drag;
GdkDrop *drop;
/* Source/dest for non-local dnd */
seat->pending_builder = NULL;
seat->pending_offer = NULL;
- seat->drop = gdk_wayland_drop_new (device, formats, dest_surface, offer, serial);
+ seat->drop = gdk_wayland_drop_new (device, seat->drag, formats, dest_surface, offer, serial);
gdk_wayland_seat_discard_pending_offer (seat);
gdk_wayland_pointer_data_finalize (&seat->pointer_info);
/* FIXME: destroy data_device */
g_clear_object (&seat->keyboard_settings);
+ g_clear_object (&seat->drag);
g_clear_object (&seat->drop);
g_clear_object (&seat->clipboard);
g_clear_object (&seat->primary_clipboard);
NULL);
}
+void
+gdk_wayland_seat_set_drag (GdkSeat *seat,
+ GdkDragContext *context)
+{
+ GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (seat);
+
+ g_set_object (&wayland_seat->drag, context);
+}
+
struct wl_data_device *
gdk_wayland_device_get_data_device (GdkDevice *gdk_device)
{
gboolean success)
{
GdkWaylandDragContext *context_wayland = GDK_WAYLAND_DRAG_CONTEXT (context);
+ GdkDevice *device = gdk_drag_context_get_device (context);
+
+ gdk_wayland_seat_set_drag (gdk_device_get_seat (device), context);
if (success)
{
{
GdkWaylandDragContext *context_wayland;
GdkDragContext *context;
+ GdkSeat *seat;
GdkWaylandDisplay *display_wayland;
display_wayland = GDK_WAYLAND_DISPLAY (gdk_device_get_display (device));
+ seat = gdk_device_get_seat (device);
context_wayland = g_object_new (GDK_TYPE_WAYLAND_DRAG_CONTEXT,
"device", device,
gdk_to_wl_actions (actions));
}
+ gdk_wayland_seat_set_drag (seat, context);
+
wl_data_device_start_drag (gdk_wayland_device_get_data_device (device),
context_wayland->data_source,
gdk_wayland_surface_get_wl_surface (surface),
context_wayland->dnd_wl_surface,
_gdk_wayland_display_get_serial (display_wayland));
- gdk_seat_ungrab (gdk_device_get_seat (device));
+ gdk_seat_ungrab (seat);
return context;
}
GdkDrop *
gdk_wayland_drop_new (GdkDevice *device,
+ GdkDragContext *drag,
GdkContentFormats *formats,
GdkSurface *surface,
struct wl_data_offer *offer,
drop = g_object_new (GDK_TYPE_WAYLAND_DROP,
"device", device,
+ "drag", drag,
"formats", formats,
"surface", surface,
NULL);
int x,
int y);
GdkDrop * gdk_wayland_drop_new (GdkDevice *device,
+ GdkDragContext *drag,
GdkContentFormats *formats,
GdkSurface *surface,
struct wl_data_offer *offer,
void gdk_wayland_seat_set_global_cursor (GdkSeat *seat,
GdkCursor *cursor);
+void gdk_wayland_seat_set_drag (GdkSeat *seat,
+ GdkDragContext *drag);
struct wl_output *gdk_wayland_surface_get_wl_output (GdkSurface *surface);