forked from AuroraMiddleware/gtk
gdk: Remove gdk_surface_register_dnd()
All surfaces are expected to be DND surfaces from creation.
This commit is contained in:
parent
8d5cece080
commit
b0f6996892
@ -171,8 +171,6 @@ _gdk_broadway_display_open (const gchar *display_name)
|
||||
|
||||
gdk_event_init (display);
|
||||
|
||||
_gdk_broadway_display_init_dnd (display);
|
||||
|
||||
if (display_name == NULL)
|
||||
display_name = g_getenv ("BROADWAY_DISPLAY");
|
||||
|
||||
|
@ -104,16 +104,6 @@ _gdk_broadway_surface_drag_begin (GdkSurface *surface,
|
||||
return new_context;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_surface_register_dnd (GdkSurface *surface)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_display_init_dnd (GdkDisplay *display)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_drag_class_init (GdkBroadwayDragClass *klass)
|
||||
{
|
||||
|
@ -47,7 +47,6 @@ void gdk_broadway_surface_set_nodes (GdkSurface *surface,
|
||||
GArray *nodes,
|
||||
GPtrArray *node_textures);
|
||||
|
||||
void _gdk_broadway_surface_register_dnd (GdkSurface *surface);
|
||||
GdkDrag * _gdk_broadway_surface_drag_begin (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkContentProvider *content,
|
||||
@ -91,7 +90,6 @@ void _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
BroadwayInputMsg *message);
|
||||
|
||||
void _gdk_broadway_display_init_root_window (GdkDisplay *display);
|
||||
void _gdk_broadway_display_init_dnd (GdkDisplay *display);
|
||||
GdkDisplay * _gdk_broadway_display_open (const gchar *display_name);
|
||||
void _gdk_broadway_display_queue_events (GdkDisplay *display);
|
||||
GdkCursor*_gdk_broadway_display_get_cursor_for_name (GdkDisplay *display,
|
||||
|
@ -1462,6 +1462,5 @@ gdk_broadway_surface_class_init (GdkBroadwaySurfaceClass *klass)
|
||||
impl_class->begin_move_drag = gdk_broadway_surface_begin_move_drag;
|
||||
impl_class->set_opacity = gdk_broadway_surface_set_opacity;
|
||||
impl_class->destroy_notify = gdk_broadway_surface_destroy_notify;
|
||||
impl_class->register_dnd = _gdk_broadway_surface_register_dnd;
|
||||
impl_class->drag_begin = _gdk_broadway_surface_drag_begin;
|
||||
}
|
||||
|
@ -3560,18 +3560,6 @@ gdk_surface_destroy_notify (GdkSurface *surface)
|
||||
GDK_SURFACE_GET_CLASS (surface)->destroy_notify (surface);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_surface_register_dnd:
|
||||
* @surface: a #GdkSurface.
|
||||
*
|
||||
* Registers a surface as a potential drop destination.
|
||||
*/
|
||||
void
|
||||
gdk_surface_register_dnd (GdkSurface *surface)
|
||||
{
|
||||
GDK_SURFACE_GET_CLASS (surface)->register_dnd (surface);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_drag_begin:
|
||||
* @surface: the source surface for this drag
|
||||
|
@ -532,8 +532,6 @@ void gdk_surface_set_keep_below (GdkSurface *surface,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_set_opacity (GdkSurface *surface,
|
||||
gdouble opacity);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_register_dnd (GdkSurface *surface);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_begin_resize_drag (GdkSurface *surface,
|
||||
|
@ -225,7 +225,6 @@ struct _GdkSurfaceClass
|
||||
void (* set_opacity) (GdkSurface *surface,
|
||||
gdouble opacity);
|
||||
void (* destroy_notify) (GdkSurface *surface);
|
||||
void (* register_dnd) (GdkSurface *surface);
|
||||
GdkDrag * (*drag_begin) (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkContentProvider*content,
|
||||
|
@ -69,12 +69,6 @@ gdk_quartz_drag_context_drag_abort (GdkDragContext *context,
|
||||
/* FIXME: Implement */
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_surface_register_dnd (GdkSurface *window)
|
||||
{
|
||||
/* FIXME: Implement */
|
||||
}
|
||||
|
||||
id
|
||||
gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext *context)
|
||||
{
|
||||
|
@ -76,7 +76,6 @@ gboolean _gdk_quartz_keys_is_modifier (guint keycode);
|
||||
void _gdk_quartz_synthesize_null_key_event (GdkSurface *window);
|
||||
|
||||
/* Drag and Drop */
|
||||
void _gdk_quartz_surface_register_dnd (GdkSurface *window);
|
||||
GdkDragContext * _gdk_quartz_surface_drag_begin (GdkSurface *window,
|
||||
GdkDevice *device,
|
||||
GList *targets,
|
||||
|
@ -2747,7 +2747,6 @@ gdk_surface_impl_quartz_class_init (GdkSurfaceImplQuartzClass *klass)
|
||||
impl_class->set_opacity = gdk_quartz_surface_set_opacity;
|
||||
impl_class->set_shadow_width = gdk_quartz_surface_set_shadow_width;
|
||||
impl_class->destroy_notify = gdk_quartz_surface_destroy_notify;
|
||||
impl_class->register_dnd = _gdk_quartz_surface_register_dnd;
|
||||
impl_class->drag_begin = _gdk_quartz_surface_drag_begin;
|
||||
impl_class->process_updates_recurse = _gdk_quartz_surface_process_updates_recurse;
|
||||
|
||||
|
@ -198,11 +198,6 @@ gdk_wayland_drag_class_init (GdkWaylandDragClass *klass)
|
||||
drag_class->cancel = gdk_wayland_drag_cancel;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_surface_register_dnd (GdkSurface *surface)
|
||||
{
|
||||
}
|
||||
|
||||
static GdkSurface *
|
||||
create_dnd_surface (GdkDisplay *display)
|
||||
{
|
||||
|
@ -99,7 +99,6 @@ void gdk_wayland_surface_attach_image (GdkSurface
|
||||
cairo_surface_t *cairo_surface,
|
||||
const cairo_region_t *damage);
|
||||
|
||||
void _gdk_wayland_surface_register_dnd (GdkSurface *surface);
|
||||
GdkDrag *_gdk_wayland_surface_drag_begin (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkContentProvider *content,
|
||||
|
@ -3933,7 +3933,6 @@ gdk_wayland_surface_class_init (GdkWaylandSurfaceClass *klass)
|
||||
impl_class->begin_move_drag = gdk_wayland_surface_begin_move_drag;
|
||||
impl_class->set_opacity = gdk_wayland_surface_set_opacity;
|
||||
impl_class->destroy_notify = gdk_wayland_surface_destroy_notify;
|
||||
impl_class->register_dnd = _gdk_wayland_surface_register_dnd;
|
||||
impl_class->drag_begin = _gdk_wayland_surface_drag_begin;
|
||||
impl_class->get_scale_factor = gdk_wayland_surface_get_scale_factor;
|
||||
impl_class->set_opaque_region = gdk_wayland_surface_set_opaque_region;
|
||||
|
@ -650,6 +650,7 @@ _gdk_win32_display_create_surface (GdkDisplay *display,
|
||||
}
|
||||
|
||||
_gdk_win32_surface_enable_transparency (surface);
|
||||
_gdk_win32_surface_register_dnd (surface);
|
||||
|
||||
g_signal_connect (frame_clock,
|
||||
"after-paint",
|
||||
@ -5236,7 +5237,6 @@ gdk_win32_surface_class_init (GdkWin32SurfaceClass *klass)
|
||||
impl_class->begin_move_drag = gdk_win32_surface_begin_move_drag;
|
||||
impl_class->set_opacity = gdk_win32_surface_set_opacity;
|
||||
impl_class->destroy_notify = gdk_win32_surface_destroy_notify;
|
||||
impl_class->register_dnd = _gdk_win32_surface_register_dnd;
|
||||
impl_class->drag_begin = _gdk_win32_surface_drag_begin;
|
||||
impl_class->create_gl_context = _gdk_win32_surface_create_gl_context;
|
||||
impl_class->get_scale_factor = _gdk_win32_surface_get_scale_factor;
|
||||
|
@ -923,6 +923,8 @@ _gdk_x11_display_create_surface (GdkDisplay *display,
|
||||
GDK_SURFACE_XID (surface), GDK_ALL_EVENTS_MASK,
|
||||
StructureNotifyMask | PropertyChangeMask);
|
||||
|
||||
_gdk_x11_surface_register_dnd (surface);
|
||||
|
||||
connect_frame_clock (surface);
|
||||
|
||||
gdk_surface_freeze_updates (surface);
|
||||
@ -4730,7 +4732,6 @@ gdk_x11_surface_class_init (GdkX11SurfaceClass *klass)
|
||||
impl_class->begin_move_drag = gdk_x11_surface_begin_move_drag;
|
||||
impl_class->set_opacity = gdk_x11_surface_set_opacity;
|
||||
impl_class->destroy_notify = gdk_x11_surface_destroy_notify;
|
||||
impl_class->register_dnd = _gdk_x11_surface_register_dnd;
|
||||
impl_class->drag_begin = _gdk_x11_surface_drag_begin;
|
||||
impl_class->get_scale_factor = gdk_x11_surface_get_scale_factor;
|
||||
impl_class->set_opaque_region = gdk_x11_surface_set_opaque_region;
|
||||
|
@ -122,9 +122,6 @@ static gboolean gtk_drop_target_handle_event (GtkEventController *controller,
|
||||
double y);
|
||||
static gboolean gtk_drop_target_filter_event (GtkEventController *controller,
|
||||
GdkEvent *event);
|
||||
static void gtk_drop_target_set_widget (GtkEventController *controller,
|
||||
GtkWidget *widget);
|
||||
static void gtk_drop_target_unset_widget (GtkEventController *controller);
|
||||
|
||||
static gboolean gtk_drop_target_get_contains (GtkDropTarget *dest);
|
||||
static void gtk_drop_target_set_contains (GtkDropTarget *dest,
|
||||
@ -221,8 +218,6 @@ gtk_drop_target_class_init (GtkDropTargetClass *class)
|
||||
|
||||
controller_class->handle_event = gtk_drop_target_handle_event;
|
||||
controller_class->filter_event = gtk_drop_target_filter_event;
|
||||
controller_class->set_widget = gtk_drop_target_set_widget;
|
||||
controller_class->unset_widget = gtk_drop_target_unset_widget;
|
||||
|
||||
class->accept = gtk_drop_target_accept;
|
||||
|
||||
@ -499,25 +494,6 @@ gtk_drop_target_get_actions (GtkDropTarget *dest)
|
||||
return dest->actions;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_drag_dest_realized (GtkWidget *widget)
|
||||
{
|
||||
GtkNative *native = gtk_widget_get_native (widget);
|
||||
|
||||
gdk_surface_register_dnd (gtk_native_get_surface (native));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_drag_dest_hierarchy_changed (GtkWidget *widget,
|
||||
GParamSpec *pspec,
|
||||
gpointer data)
|
||||
{
|
||||
GtkNative *native = gtk_widget_get_native (widget);
|
||||
|
||||
if (native && gtk_widget_get_realized (GTK_WIDGET (native)))
|
||||
gdk_surface_register_dnd (gtk_native_get_surface (native));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_drop_target_get_drop:
|
||||
* @dest: a #GtkDropTarget
|
||||
@ -838,34 +814,6 @@ gtk_drag_dest_handle_event (GtkWidget *toplevel,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_drop_target_set_widget (GtkEventController *controller,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GtkDropTarget *dest = GTK_DROP_TARGET (controller);
|
||||
|
||||
GTK_EVENT_CONTROLLER_CLASS (gtk_drop_target_parent_class)->set_widget (controller, widget);
|
||||
|
||||
if (gtk_widget_get_realized (widget))
|
||||
gtk_drag_dest_realized (widget);
|
||||
|
||||
g_signal_connect (widget, "realize", G_CALLBACK (gtk_drag_dest_realized), dest);
|
||||
g_signal_connect (widget, "notify::root", G_CALLBACK (gtk_drag_dest_hierarchy_changed), dest);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_drop_target_unset_widget (GtkEventController *controller)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
|
||||
widget = gtk_event_controller_get_widget (controller);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (widget, gtk_drag_dest_realized, controller);
|
||||
g_signal_handlers_disconnect_by_func (widget, gtk_drag_dest_hierarchy_changed, controller);
|
||||
|
||||
GTK_EVENT_CONTROLLER_CLASS (gtk_drop_target_parent_class)->unset_widget (controller);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_drag_get_data_got_data (GObject *source,
|
||||
GAsyncResult *result,
|
||||
|
Loading…
Reference in New Issue
Block a user