diff options
author | Benjamin Otte <otte@redhat.com> | 2017-11-16 00:43:31 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2017-11-16 22:59:42 +0100 |
commit | b200d4f099f73de22f289ea12a397ca50ccc7a2b (patch) | |
tree | 3bb25d899d0fad824ae427ab0d23e10e057c5344 /gtk/gtktextview.c | |
parent | 47e75b34a473032ebc6e24ac37fb7dbda34869a8 (diff) | |
download | gtk+-b200d4f099f73de22f289ea12a397ca50ccc7a2b.tar.gz |
textview: Stop playing shenanigans with the target list
This breaks GtkSourceView adding custom targets on top of GtkTextView,
but we'll fix that later.
Diffstat (limited to 'gtk/gtktextview.c')
-rw-r--r-- | gtk/gtktextview.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 8536b82da1..106a2762a3 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -8661,42 +8661,7 @@ gtk_text_view_target_list_notify (GtkTextBuffer *buffer, const GParamSpec *pspec, gpointer data) { - GtkWidget *widget = GTK_WIDGET (data); - GtkTargetList *view_list; - GtkTargetList *buffer_list; - GList *list; - - view_list = gtk_drag_dest_get_target_list (widget); - buffer_list = gtk_text_buffer_get_paste_target_list (buffer); - - if (view_list) - gtk_target_list_ref (view_list); - else - view_list = gtk_target_list_new (NULL, 0); - - list = view_list->list; - while (list) - { - GtkTargetPair *pair = list->data; - - list = list->next; /* get next element before removing */ - - if (pair->info >= GTK_TEXT_BUFFER_TARGET_INFO_TEXT && - pair->info <= GTK_TEXT_BUFFER_TARGET_INFO_BUFFER_CONTENTS) - { - gtk_target_list_remove (view_list, pair->target); - } - } - - for (list = buffer_list->list; list; list = list->next) - { - GtkTargetPair *pair = list->data; - - gtk_target_list_add (view_list, pair->target, pair->flags, pair->info); - } - - gtk_drag_dest_set_target_list (widget, view_list); - gtk_target_list_unref (view_list); + gtk_drag_dest_set_target_list (data, gtk_text_buffer_get_paste_target_list (buffer)); } static void |