dnd: Remove gdk_drag_get_selection()
authorBenjamin Otte <otte@redhat.com>
Thu, 14 Dec 2017 03:34:33 +0000 (04:34 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 14 Dec 2017 03:39:22 +0000 (04:39 +0100)
Without selections, drags can't have them either.

Also included is removing the selection from GtkSelectionData.

Includes a bunch of crude cleanups to Wayland code that no longer has to
care about selection atoms.

17 files changed:
docs/reference/gdk/gdk4-sections.txt
docs/reference/gtk/gtk4-sections.txt
gdk/broadway/gdkdnd-broadway.c
gdk/gdkdnd.c
gdk/gdkdnd.h
gdk/gdkdndprivate.h
gdk/quartz/gdkdnd-quartz.c
gdk/wayland/gdkdevice-wayland.c
gdk/wayland/gdkdnd-wayland.c
gdk/wayland/gdkprivate-wayland.h
gdk/wayland/gdkselection-wayland.c
gdk/win32/gdkdnd-win32.c
gdk/x11/gdkdnd-x11.c
gtk/gtkdnd.c
gtk/gtkselection.c
gtk/gtkselection.h
gtk/gtkselectionprivate.h

index 04b333b3ffdaf6ef2515f942884fbe13295ff70d..fd40debf38d0383ec9e40a37f3a8298a4f83ba50 100644 (file)
@@ -805,7 +805,6 @@ gdk_cursor_get_type
 <FILE>dnd</FILE>
 GdkDragContext
 GdkDragCancelReason
-gdk_drag_get_selection
 gdk_drop_reply
 gdk_drag_drop_done
 gdk_drag_begin
index 81bcf7a8adc45f28a64c0318b67d1a2a27700618..bea54de64331e60b1f0c486e609b1c96ff57ca71 100644 (file)
@@ -5200,7 +5200,6 @@ gtk_selection_data_get_targets
 gtk_selection_data_targets_include_image
 gtk_selection_data_targets_include_text
 gtk_selection_data_targets_include_uri
-gtk_selection_data_get_selection
 gtk_selection_data_get_data
 gtk_selection_data_get_length
 gtk_selection_data_get_data_with_length
index 3747ca1e88e67df58469e06fedae7b3d7f2e1c63..4c78b06e344b997f5bef6ae8f95b065b52987782 100644 (file)
@@ -176,14 +176,6 @@ _gdk_broadway_window_register_dnd (GdkWindow      *window)
 {
 }
 
-static GdkAtom
-gdk_broadway_drag_context_get_selection (GdkDragContext *context)
-{
-  g_return_val_if_fail (context != NULL, NULL);
-
-  return NULL;
-}
-
 static gboolean
 gdk_broadway_drag_context_drop_status (GdkDragContext *context)
 {
@@ -213,5 +205,4 @@ gdk_broadway_drag_context_class_init (GdkBroadwayDragContextClass *klass)
   context_class->drop_reply = gdk_broadway_drag_context_drop_reply;
   context_class->drop_finish = gdk_broadway_drag_context_drop_finish;
   context_class->drop_status = gdk_broadway_drag_context_drop_status;
-  context_class->get_selection = gdk_broadway_drag_context_get_selection;
 }
index e0e0c3e7c7f8f28f1fd21f85f1d574064f223014..44de31c25a307bf30458ebeb9ebe0cb086e11b59 100644 (file)
@@ -693,22 +693,6 @@ gdk_drag_drop_succeeded (GdkDragContext *context)
   return GDK_DRAG_CONTEXT_GET_CLASS (context)->drop_status (context);
 }
 
-/**
- * gdk_drag_get_selection:
- * @context: a #GdkDragContext.
- *
- * Returns the selection atom for the current source window.
- *
- * Returns: (transfer none): the selection atom, or %NULL
- */
-GdkAtom
-gdk_drag_get_selection (GdkDragContext *context)
-{
-  g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
-
-  return GDK_DRAG_CONTEXT_GET_CLASS (context)->get_selection (context);
-}
-
 static void
 gdk_drag_context_write_done (GObject      *content,
                              GAsyncResult *result,
index 8f75a7d1d2d6c001443324f46862371f299d38e1..683b508a34f62e34149b4e24ba9889f594327040 100644 (file)
@@ -115,8 +115,6 @@ GDK_AVAILABLE_IN_ALL
 void             gdk_drop_finish        (GdkDragContext   *context,
                                          gboolean          success,
                                          guint32           time_);
-GDK_AVAILABLE_IN_ALL
-GdkAtom          gdk_drag_get_selection (GdkDragContext   *context);
 
 GDK_AVAILABLE_IN_3_94
 void                    gdk_drop_read_async             (GdkDragContext        *context,
index 127b51426503334c817afd89734954c10a1aa094..05f10435fed1acba6dcd928bf742df90746e18c3 100644 (file)
@@ -65,7 +65,6 @@ struct _GdkDragContextClass {
                                 gint             x_root,
                                 gint             y_root,
                                 GdkDragProtocol *protocol);
-  GdkAtom     (*get_selection) (GdkDragContext  *context);
   gboolean    (*drag_motion)   (GdkDragContext  *context,
                                 GdkWindow       *dest_window,
                                 GdkDragProtocol  protocol,
index 21438481b41a27fc2fba8b082be1a242ef754f4b..65412b03c3f0a099a5676efbcb3c9426afe4ebe3 100644 (file)
@@ -126,13 +126,6 @@ _gdk_quartz_window_register_dnd (GdkWindow *window)
   /* FIXME: Implement */
 }
 
-static GdkAtom
-gdk_quartz_drag_context_get_selection (GdkDragContext *context)
-{
-  /* FIXME: Implement */
-  return NULL;
-}
-
 static gboolean
 gdk_quartz_drag_context_drop_status (GdkDragContext *context)
 {
@@ -173,5 +166,4 @@ gdk_quartz_drag_context_class_init (GdkQuartzDragContextClass *klass)
   context_class->drop_reply = gdk_quartz_drag_context_drop_reply;
   context_class->drop_finish = gdk_quartz_drag_context_drop_finish;
   context_class->drop_status = gdk_quartz_drag_context_drop_status;
-  context_class->get_selection = gdk_quartz_drag_context_get_selection;
 }
index 9d5b8d5f286a2eee33d0ad52a2f4554163f18fda..c170325c4626b586bc3a4fd61b72eb54149c58de 100644 (file)
@@ -1080,7 +1080,6 @@ data_device_enter (void                  *data,
 {
   GdkWaylandSeat *seat = data;
   GdkWindow *dest_window, *dnd_owner;
-  GdkAtom selection;
 
   dest_window = wl_surface_get_user_data (surface);
 
@@ -1098,8 +1097,6 @@ data_device_enter (void                  *data,
 
   gdk_wayland_drop_context_update_targets (seat->drop_context);
 
-  selection = gdk_drag_get_selection (seat->drop_context);
-
   dnd_owner = seat->foreign_dnd_window;
 
   _gdk_wayland_drag_context_set_source_window (seat->drop_context, dnd_owner);
@@ -1112,9 +1109,7 @@ data_device_enter (void                  *data,
   _gdk_wayland_drag_context_emit_event (seat->drop_context, GDK_DRAG_ENTER,
                                         GDK_CURRENT_TIME);
 
-  gdk_wayland_selection_set_offer (seat->display, selection, offer);
-
-  /* emit_selection_owner_change (dest_window, selection); */
+  gdk_wayland_selection_set_offer (seat->display, offer);
 }
 
 static void
index 05947c5bad283600cb870bc66678d7623e64709b..a7f0aa8e8877e9fc9a3b65c6db86ae736c8071b1 100644 (file)
@@ -227,8 +227,7 @@ gdk_wayland_drop_context_set_status (GdkDragContext *context,
   context_wayland = GDK_WAYLAND_DRAG_CONTEXT (context);
 
   display = gdk_device_get_display (gdk_drag_context_get_device (context));
-  wl_offer = gdk_wayland_selection_get_offer (display,
-                                              gdk_drag_get_selection (context));
+  wl_offer = gdk_wayland_selection_get_offer (display);
 
   if (!wl_offer)
     return;
@@ -300,11 +299,9 @@ gdk_wayland_drag_context_drop_finish (GdkDragContext *context,
   GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
   GdkWaylandDragContext *wayland_context;
   struct wl_data_offer *wl_offer;
-  GdkAtom selection;
 
   wayland_context = GDK_WAYLAND_DRAG_CONTEXT (context);
-  selection = gdk_drag_get_selection (context);
-  wl_offer = gdk_wayland_selection_get_offer (display, selection);
+  wl_offer = gdk_wayland_selection_get_offer (display);
 
   if (wl_offer && success && wayland_context->selected_action &&
       wayland_context->selected_action != GDK_ACTION_ASK)
@@ -316,7 +313,7 @@ gdk_wayland_drag_context_drop_finish (GdkDragContext *context,
         wl_data_offer_finish (wl_offer);
     }
 
-  gdk_wayland_selection_set_offer (display, selection, NULL);
+  gdk_wayland_selection_set_offer (display, NULL);
 }
 
 static void
@@ -344,8 +341,7 @@ gdk_wayland_drag_context_read_async (GdkDragContext      *context,
   GDK_NOTE (DND, char *s = gdk_content_formats_to_string (formats);
                  g_printerr ("%p: read for %s\n", context, s);
                  g_free (s); );
-  dnd_formats = gdk_wayland_selection_get_targets (display,
-                                                   gdk_drag_get_selection (context));                      
+  dnd_formats = gdk_wayland_selection_get_targets (display);
   mime_type = gdk_content_formats_match_mime_type (formats, dnd_formats);
   if (mime_type == NULL)
     {
@@ -354,8 +350,7 @@ gdk_wayland_drag_context_read_async (GdkDragContext      *context,
       return;
     }
   /* offer formats should be empty if we have no offer */
-  offer = gdk_wayland_selection_get_offer (display,
-                                           gdk_drag_get_selection (context));
+  offer = gdk_wayland_selection_get_offer (display);
   g_assert (offer);
 
   g_task_set_task_data (task, (gpointer) mime_type, NULL);
@@ -399,12 +394,6 @@ gdk_wayland_drag_context_drop_status (GdkDragContext *context)
   return FALSE;
 }
 
-static GdkAtom
-gdk_wayland_drag_context_get_selection (GdkDragContext *context)
-{
-  return gdk_atom_intern_static_string ("GdkWaylandSelection");
-}
-
 static void
 gdk_wayland_drag_context_init (GdkWaylandDragContext *context_wayland)
 {
@@ -510,7 +499,6 @@ gdk_wayland_drag_context_class_init (GdkWaylandDragContextClass *klass)
   context_class->read_async = gdk_wayland_drag_context_read_async;
   context_class->read_finish = gdk_wayland_drag_context_read_finish;
   context_class->drop_status = gdk_wayland_drag_context_drop_status;
-  context_class->get_selection = gdk_wayland_drag_context_get_selection;
   context_class->get_drag_window = gdk_wayland_drag_context_get_drag_window;
   context_class->set_hotspot = gdk_wayland_drag_context_set_hotspot;
   context_class->drop_done = gdk_wayland_drag_context_drop_done;
@@ -568,8 +556,7 @@ _gdk_wayland_window_drag_begin (GdkWindow          *window,
   context_wayland->dnd_window = create_dnd_window (gdk_window_get_display (window));
   context_wayland->dnd_surface = gdk_wayland_window_get_wl_surface (context_wayland->dnd_window);
   context_wayland->data_source =
-  gdk_wayland_selection_get_data_source (window,
-                                         gdk_wayland_drag_context_get_selection (context));
+  gdk_wayland_selection_get_data_source (window);
 
   mimetypes = gdk_content_formats_get_mime_types (context->formats, &n_mimetypes);
   for (i = 0; i < n_mimetypes; i++)
@@ -624,8 +611,7 @@ gdk_wayland_drop_context_update_targets (GdkDragContext *context)
   device = gdk_drag_context_get_device (context);
   display = gdk_device_get_display (device);
   gdk_content_formats_unref (context->formats);
-  context->formats = gdk_wayland_selection_get_targets (display,
-                                                        gdk_drag_get_selection (context));
+  context->formats = gdk_wayland_selection_get_targets (display);
   if (context->formats)
     gdk_content_formats_ref (context->formats);
   else
index afd2a2bfd030890751b41c32366feac2b5708806..39d6cfe1b35f711a7db771bdfc2687e3b85fff0d 100644 (file)
@@ -201,16 +201,12 @@ void gdk_wayland_selection_ensure_primary_offer (GdkDisplay
 GdkContentFormats *gdk_wayland_selection_steal_offer (GdkDisplay *display, gpointer wl_offer);
 
 void gdk_wayland_selection_set_offer (GdkDisplay           *display,
-                                      GdkAtom               selection,
                                       gpointer              offer);
-gpointer gdk_wayland_selection_get_offer (GdkDisplay *display,
-                                          GdkAtom     selection);
-GdkContentFormats *gdk_wayland_selection_get_targets (GdkDisplay *display,
-                                                      GdkAtom     selection);
-
-struct wl_data_source * gdk_wayland_selection_get_data_source (GdkWindow *owner,
-                                                               GdkAtom    selection);
-void gdk_wayland_selection_unset_data_source (GdkDisplay *display, GdkAtom selection);
+gpointer gdk_wayland_selection_get_offer (GdkDisplay *display);
+GdkContentFormats *gdk_wayland_selection_get_targets (GdkDisplay *display);
+
+struct wl_data_source * gdk_wayland_selection_get_data_source (GdkWindow *owner);
+void gdk_wayland_selection_unset_data_source (GdkDisplay *display);
 gboolean gdk_wayland_selection_set_current_offer_actions (GdkDisplay *display,
                                                           uint32_t    actions);
 
index 97482af55cae4a24cfc00e12ec63503c5de7ee1e..e89102dafaecd9e7252c4da5ec8d93e1c219d58c 100644 (file)
 
 #include <string.h>
 
-typedef struct _SelectionBuffer SelectionBuffer;
 typedef struct _SelectionData SelectionData;
-typedef struct _StoredSelection StoredSelection;
 typedef struct _DataOfferData DataOfferData;
 
-struct _SelectionBuffer
-{
-  GInputStream *stream;
-  GCancellable *cancellable;
-  GByteArray *data;
-  GList *requestors;
-  GdkAtom selection;
-  GdkAtom target;
-  gint ref_count;
-};
-
-struct _StoredSelection
-{
-  GdkWindow *source;
-  GCancellable *cancellable;
-  guchar *data;
-  gsize data_len;
-  GdkAtom type;
-  gint fd;
-};
-
 struct _DataOfferData
 {
   GDestroyNotify destroy_notify;
@@ -71,22 +48,12 @@ struct _SelectionData
   DataOfferData *offer;
 };
 
-enum {
-  ATOM_DND,
-  N_ATOMS
-};
-
-static GdkAtom atoms[N_ATOMS] = { 0 };
-
 struct _GdkWaylandSelection
 {
   /* Destination-side data */
-  SelectionData selections[N_ATOMS];
+  SelectionData selection;
   GHashTable *offers; /* Currently alive offers, Hashtable of wl_data_offer->DataOfferData */
 
-  /* Source-side data */
-  StoredSelection stored_selection;
-
   struct wl_data_source *dnd_source; /* Owned by the GdkDragContext */
 };
 
@@ -117,15 +84,11 @@ gdk_wayland_selection_new (void)
 {
   GdkWaylandSelection *selection;
 
-  /* init atoms */
-  atoms[ATOM_DND] = gdk_atom_intern_static_string ("GdkWaylandSelection");
-
   selection = g_new0 (GdkWaylandSelection, 1);
 
   selection->offers =
     g_hash_table_new_full (NULL, NULL, NULL,
                            (GDestroyNotify) data_offer_data_free);
-  selection->stored_selection.fd = -1;
   return selection;
 }
 
@@ -133,16 +96,6 @@ void
 gdk_wayland_selection_free (GdkWaylandSelection *selection)
 {
   g_hash_table_destroy (selection->offers);
-  g_free (selection->stored_selection.data);
-
-  if (selection->stored_selection.cancellable)
-    {
-      g_cancellable_cancel (selection->stored_selection.cancellable);
-      g_object_unref (selection->stored_selection.cancellable);
-    }
-
-  if (selection->stored_selection.fd > 0)
-    close (selection->stored_selection.fd);
 
   if (selection->dnd_source)
     wl_data_source_destroy (selection->dnd_source);
@@ -243,13 +196,9 @@ static const struct wl_data_offer_listener data_offer_listener = {
 };
 
 static SelectionData *
-selection_lookup_offer_by_atom (GdkWaylandSelection *selection,
-                                GdkAtom              selection_atom)
+selection_lookup_offer_by_atom (GdkWaylandSelection *selection)
 {
-  if (selection_atom == atoms[ATOM_DND])
-    return &selection->selections[ATOM_DND];
-  else
-    return NULL;
+  return &selection->selection;
 }
 
 void
@@ -293,7 +242,6 @@ gdk_wayland_selection_steal_offer (GdkDisplay *display,
 
 void
 gdk_wayland_selection_set_offer (GdkDisplay *display,
-                                 GdkAtom     selection_atom,
                                  gpointer    wl_offer)
 {
   GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
@@ -303,12 +251,12 @@ gdk_wayland_selection_set_offer (GdkDisplay *display,
 
   info = g_hash_table_lookup (selection->offers, wl_offer);
 
-  prev_offer = gdk_wayland_selection_get_offer (display, selection_atom);
+  prev_offer = gdk_wayland_selection_get_offer (display);
 
   if (prev_offer)
     g_hash_table_remove (selection->offers, prev_offer);
 
-  selection_data = selection_lookup_offer_by_atom (selection, selection_atom);
+  selection_data = selection_lookup_offer_by_atom (selection);
 
   if (selection_data)
     {
@@ -317,13 +265,12 @@ gdk_wayland_selection_set_offer (GdkDisplay *display,
 }
 
 gpointer
-gdk_wayland_selection_get_offer (GdkDisplay *display,
-                                 GdkAtom     selection_atom)
+gdk_wayland_selection_get_offer (GdkDisplay *display)
 {
   GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
   const SelectionData *data;
 
-  data = selection_lookup_offer_by_atom (selection, selection_atom);
+  data = selection_lookup_offer_by_atom (selection);
 
   if (data && data->offer)
     return data->offer->offer_data;
@@ -332,13 +279,12 @@ gdk_wayland_selection_get_offer (GdkDisplay *display,
 }
 
 GdkContentFormats *
-gdk_wayland_selection_get_targets (GdkDisplay *display,
-                                   GdkAtom     selection_atom)
+gdk_wayland_selection_get_targets (GdkDisplay *display)
 {
   GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
   const SelectionData *data;
 
-  data = selection_lookup_offer_by_atom (selection, selection_atom);
+  data = selection_lookup_offer_by_atom (selection);
 
   if (data && data->offer)
     return data->offer->targets;
@@ -407,16 +353,13 @@ data_source_cancelled (void                  *data,
   GdkWaylandSelection *wayland_selection = data;
   GdkDragContext *context;
   GdkDisplay *display;
-  GdkAtom atom;
 
   GDK_NOTE (EVENTS,
             g_message ("data source cancelled, source = %p", source));
 
   display = gdk_display_get_default ();
 
-  if (source == wayland_selection->dnd_source)
-    atom = atoms[ATOM_DND];
-  else
+  if (source != wayland_selection->dnd_source)
     return;
 
   context = gdk_wayland_drag_context_lookup_by_data_source (source);
@@ -424,7 +367,7 @@ data_source_cancelled (void                  *data,
   if (context)
     gdk_drag_context_cancel (context, GDK_DRAG_CANCEL_ERROR);
 
-  gdk_wayland_selection_unset_data_source (display, atom);
+  gdk_wayland_selection_unset_data_source (display);
 }
 
 static void
@@ -485,24 +428,15 @@ static const struct wl_data_source_listener data_source_listener = {
 };
 
 struct wl_data_source *
-gdk_wayland_selection_get_data_source (GdkWindow *owner,
-                                       GdkAtom    selection)
+gdk_wayland_selection_get_data_source (GdkWindow *owner)
 {
   GdkDisplay *display = gdk_window_get_display (owner);
   GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
   gpointer source = NULL;
   GdkWaylandDisplay *display_wayland;
 
-  if (selection == atoms[ATOM_DND])
-    {
-      if (wayland_selection->dnd_source)
-        return wayland_selection->dnd_source;
-    }
-  else
-    return NULL;
-
-  if (!owner)
-    return NULL;
+  if (wayland_selection->dnd_source)
+    return wayland_selection->dnd_source;
 
   display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (owner));
 
@@ -511,22 +445,17 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner,
                                &data_source_listener,
                                wayland_selection);
 
-  if (selection == atoms[ATOM_DND])
-    wayland_selection->dnd_source = source;
+  wayland_selection->dnd_source = source;
 
   return source;
 }
 
 void
-gdk_wayland_selection_unset_data_source (GdkDisplay *display,
-                                         GdkAtom     selection)
+gdk_wayland_selection_unset_data_source (GdkDisplay *display)
 {
   GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
 
-  if (selection == atoms[ATOM_DND])
-    {
-      wayland_selection->dnd_source = NULL;
-    }
+  wayland_selection->dnd_source = NULL;
 }
 
 gint
@@ -643,7 +572,7 @@ gdk_wayland_selection_set_current_offer_actions (GdkDisplay *display,
   struct wl_data_offer *offer;
   uint32_t all_actions = 0;
 
-  offer = gdk_wayland_selection_get_offer (display, atoms[ATOM_DND]);
+  offer = gdk_wayland_selection_get_offer (display);
 
   if (!offer)
     return FALSE;
index 69528076226468c25fe8d29d6c99286f82923ab3..b05cced5a647281be4e3b4bb5ef022ffe58d5c56 100644 (file)
@@ -3266,7 +3266,6 @@ gdk_win32_drag_context_class_init (GdkWin32DragContextClass *klass)
   context_class->drop_reply = gdk_win32_drag_context_drop_reply;
   context_class->drop_finish = gdk_win32_drag_context_drop_finish;
   context_class->drop_status = gdk_win32_drag_context_drop_status;
-  context_class->get_selection = gdk_win32_drag_context_get_selection;
 
   context_class->get_drag_window = gdk_win32_drag_context_get_drag_window;
   context_class->set_hotspot = gdk_win32_drag_context_set_hotspot;
index 369d92804fcdddb4a971131bd19ee15ecd1ad500..50ac8240b800b4185c772c48a676dc95acd5fcd4 100644 (file)
@@ -231,7 +231,6 @@ static void        gdk_x11_drag_context_drop_finish (GdkDragContext  *context,
                                                      gboolean         success,
                                                      guint32          time_);
 static gboolean    gdk_x11_drag_context_drop_status (GdkDragContext  *context);
-static GdkAtom     gdk_x11_drag_context_get_selection (GdkDragContext  *context);
 static GdkWindow * gdk_x11_drag_context_get_drag_window (GdkDragContext *context);
 static void        gdk_x11_drag_context_set_hotspot (GdkDragContext  *context,
                                                      gint             hot_x,
@@ -272,7 +271,7 @@ gdk_x11_drag_context_read_got_stream (GObject      *source,
           targets->next = NULL;
           g_task_set_task_data (task, next, (GDestroyNotify) g_slist_free);
           gdk_x11_selection_input_stream_new_async (gdk_drag_context_get_display (context),
-                                                    gdk_drag_get_selection (context),
+                                                    "XdndSelection",
                                                     next->data,
                                                     CurrentTime,
                                                     g_task_get_priority (task),
@@ -342,7 +341,7 @@ gdk_x11_drag_context_read_async (GdkDragContext      *context,
   GDK_NOTE(DND, g_printerr ("new read for %s (%u other options)\n",
                             (char *) targets->data, g_slist_length (targets->next)));
   gdk_x11_selection_input_stream_new_async (gdk_drag_context_get_display (context),
-                                            gdk_drag_get_selection (context),
+                                            "XdndSelection",
                                             targets->data,
                                             CurrentTime,
                                             io_priority,
@@ -392,7 +391,6 @@ gdk_x11_drag_context_class_init (GdkX11DragContextClass *klass)
   context_class->drop_status = gdk_x11_drag_context_drop_status;
   context_class->read_async = gdk_x11_drag_context_read_async;
   context_class->read_finish = gdk_x11_drag_context_read_finish;
-  context_class->get_selection = gdk_x11_drag_context_get_selection;
   context_class->get_drag_window = gdk_x11_drag_context_get_drag_window;
   context_class->set_hotspot = gdk_x11_drag_context_set_hotspot;
   context_class->drop_done = gdk_x11_drag_context_drop_done;
@@ -2588,15 +2586,6 @@ _gdk_x11_window_register_dnd (GdkWindow *window)
                    (guchar *)&xdnd_version, 1);
 }
 
-static GdkAtom
-gdk_x11_drag_context_get_selection (GdkDragContext *context)
-{
-  if (context->protocol == GDK_DRAG_PROTO_XDND)
-    return gdk_atom_intern_static_string ("XdndSelection");
-  else
-    return NULL;
-}
-
 static gboolean
 gdk_x11_drag_context_drop_status (GdkDragContext *context)
 {
index d9ec023d056c199a535f97a4f14ec020f52fa083..165b7c324b66b5b1da3fd49412c6b7b84700cce7 100644 (file)
@@ -261,7 +261,6 @@ gtk_drag_get_data_finish (GtkDragGetData *data,
 
   site = g_object_get_data (G_OBJECT (data->widget), "gtk-drag-dest");
 
-  sdata.selection = gdk_drag_get_selection (data->context);
   sdata.target = data->mime_type;
   sdata.type = data->mime_type;
   sdata.format = 8;
@@ -1015,7 +1014,6 @@ gtk_drag_content_write_mime_type_async (GdkContentProvider  *provider,
   g_task_set_priority (task, io_priority);
   g_task_set_source_tag (task, gtk_drag_content_write_mime_type_async);
 
-  sdata.selection = gdk_drag_get_selection (content->context);
   sdata.target = gdk_atom_intern (mime_type, FALSE);
   sdata.length = -1;
   sdata.display = gtk_widget_get_display (content->widget);
index 25c3b0afb5a6820057db5eab84284cfe28bf2c99..b2d4c8b559291d185cf64fd6903721506f03d373 100644 (file)
@@ -273,24 +273,6 @@ gtk_content_formats_add_uri_targets (GdkContentFormats *list)
   return gdk_content_formats_builder_free (builder);
 }
 
-/**
- * gtk_selection_data_get_selection:
- * @selection_data: a pointer to a #GtkSelectionData-struct.
- *
- * Retrieves the selection #GdkAtom of the selection data.
- *
- * Returns: (transfer none): the selection #GdkAtom of the selection data.
- *
- * Since: 2.16
- **/
-GdkAtom
-gtk_selection_data_get_selection (const GtkSelectionData *selection_data)
-{
-  g_return_val_if_fail (selection_data != NULL, 0);
-
-  return selection_data->selection;
-}
-
 /**
  * gtk_selection_data_get_target:
  * @selection_data: a pointer to a #GtkSelectionData-struct.
index 7e6b6a9f2ceaec9e5220806c80eca6a841e3578b..a855e04c3c3c3dbbff2a4aa35cc010a55ca42b57 100644 (file)
@@ -44,8 +44,6 @@ GdkContentFormats *     gtk_content_formats_add_image_targets     (GdkContentFor
 GDK_AVAILABLE_IN_ALL
 GdkContentFormats *     gtk_content_formats_add_uri_targets       (GdkContentFormats *list) G_GNUC_WARN_UNUSED_RESULT;
 
-GDK_AVAILABLE_IN_ALL
-GdkAtom       gtk_selection_data_get_selection (const GtkSelectionData *selection_data);
 GDK_AVAILABLE_IN_ALL
 GdkAtom       gtk_selection_data_get_target    (const GtkSelectionData *selection_data);
 GDK_AVAILABLE_IN_ALL
index 896fcd0c285b3974723c18cd846b16ce8ce8ab94..f31b6466851680f0255c0301b337fc20d4612029 100644 (file)
@@ -38,7 +38,6 @@ G_BEGIN_DECLS
 struct _GtkSelectionData
 {
   /*< private >*/
-  GdkAtom       selection;
   GdkAtom       target;
   GdkAtom       type;
   gint          format;