gdk_wayland_actions_to_gdk_actions (source_actions),
gdk_drag_context_get_suggested_action (drop_context));
- _gdk_wayland_drag_context_emit_event (drop_context, GDK_DRAG_MOTION,
- GDK_CURRENT_TIME);
+ gdk_drop_emit_motion_event (GDK_DROP (seat->drop_context),
+ FALSE,
+ seat->pointer_info.surface_x,
+ seat->pointer_info.surface_y,
+ GDK_CURRENT_TIME);
}
static void
gdk_drag_context_get_actions (drop_context),
gdk_wayland_actions_to_gdk_actions (action));
- _gdk_wayland_drag_context_emit_event (drop_context, GDK_DRAG_MOTION,
- GDK_CURRENT_TIME);
+ gdk_drop_emit_motion_event (GDK_DROP (seat->drop_context),
+ FALSE,
+ seat->pointer_info.surface_x,
+ seat->pointer_info.surface_y,
+ GDK_CURRENT_TIME);
}
static const struct wl_data_offer_listener data_offer_listener = {
_gdk_wayland_drag_context_set_source_surface (seat->drop_context, dnd_owner);
- _gdk_wayland_drag_context_set_coords (seat->drop_context,
- wl_fixed_to_double (x),
- wl_fixed_to_double (y));
-
gdk_wayland_seat_discard_pending_offer (seat);
- _gdk_wayland_drag_context_emit_event (seat->drop_context, GDK_DRAG_ENTER,
- GDK_CURRENT_TIME);
+ gdk_drop_emit_enter_event (GDK_DROP (seat->drop_context),
+ FALSE,
+ GDK_CURRENT_TIME);
}
static void
g_object_unref (seat->pointer_info.focus);
seat->pointer_info.focus = NULL;
- _gdk_wayland_drag_context_set_coords (seat->drop_context, -1, -1);
- _gdk_wayland_drag_context_emit_event (seat->drop_context, GDK_DRAG_LEAVE,
- GDK_CURRENT_TIME);
+ gdk_drop_emit_leave_event (GDK_DROP (seat->drop_context),
+ FALSE,
+ GDK_CURRENT_TIME);
g_clear_object (&seat->drop_context);
}
seat->pointer_info.surface_x = wl_fixed_to_double (x);
seat->pointer_info.surface_y = wl_fixed_to_double (y);
- _gdk_wayland_drag_context_set_coords (seat->drop_context,
- wl_fixed_to_double (x),
- wl_fixed_to_double (y));
- _gdk_wayland_drag_context_emit_event (seat->drop_context,
- GDK_DRAG_MOTION, time);
+ gdk_drop_emit_motion_event (GDK_DROP (seat->drop_context),
+ FALSE,
+ seat->pointer_info.surface_x,
+ seat->pointer_info.surface_y,
+ time);
}
static void
GDK_DISPLAY_NOTE (seat->display, EVENTS,
g_message ("data device drop, data device %p", data_device));
- _gdk_wayland_drag_context_emit_event (seat->drop_context,
- GDK_DROP_START, GDK_CURRENT_TIME);
+ gdk_drop_emit_drop_event (GDK_DROP (seat->drop_context),
+ FALSE,
+ seat->pointer_info.surface_x,
+ seat->pointer_info.surface_y,
+ GDK_CURRENT_TIME);
}
static void
struct wl_data_offer *offer;
GdkDragAction selected_action;
uint32_t serial;
- gdouble x;
- gdouble y;
gint hot_x;
gint hot_y;
};
gdk_surface_destroy (dnd_surface);
}
-void
-_gdk_wayland_drag_context_emit_event (GdkDragContext *context,
- GdkEventType type,
- guint32 time_)
-{
- GdkSurface *surface;
- GdkEvent *event;
-
- switch ((guint) type)
- {
- case GDK_DRAG_ENTER:
- case GDK_DRAG_LEAVE:
- case GDK_DRAG_MOTION:
- case GDK_DROP_START:
- break;
- default:
- return;
- }
-
- if (context->is_source)
- surface = gdk_drag_context_get_source_surface (context);
- else
- surface = gdk_drop_get_surface (GDK_DROP (context));
-
- event = gdk_event_new (type);
- event->any.surface = g_object_ref (surface);
- event->dnd.context = g_object_ref (context);
- event->dnd.time = time_;
- event->dnd.x_root = GDK_WAYLAND_DRAG_CONTEXT (context)->x;
- event->dnd.y_root = GDK_WAYLAND_DRAG_CONTEXT (context)->y;
- gdk_event_set_device (event, gdk_drag_context_get_device (context));
-
- gdk_display_put_event (gdk_surface_get_display (surface), event);
- g_object_unref (event);
-}
-
static inline uint32_t
gdk_to_wl_actions (GdkDragAction action)
{
return context;
}
-void
-_gdk_wayland_drag_context_set_coords (GdkDragContext *context,
- gdouble x,
- gdouble y)
-{
- GdkWaylandDragContext *context_wayland;
-
- context_wayland = GDK_WAYLAND_DRAG_CONTEXT (context);
- context_wayland->x = x;
- context_wayland->y = y;
-}
-
void
_gdk_wayland_drag_context_set_source_surface (GdkDragContext *context,
GdkSurface *surface)