diff --git a/gdk/win32/gdkselection-win32.c b/gdk/win32/gdkselection-win32.c index ce42d0d12d..a9c8d77209 100644 --- a/gdk/win32/gdkselection-win32.c +++ b/gdk/win32/gdkselection-win32.c @@ -2168,6 +2168,15 @@ convert_dnd_selection_to_target (GdkAtom target, fmt.lindex = -1; fmt.tymed = TYMED_HGLOBAL; + /* We rely on GTK+ applications to synthesize the DELETE request + * for themselves, since they do know whether a DnD operation was a + * move and whether was successful. Therefore, we do not need to + * actually send anything here. Just report back without storing + * any data. + */ + if (target == _gdk_win32_selection_atom (GDK_WIN32_ATOM_INDEX_DELETE)) + return result; + for (format = 0, with_transmute = 0; format == 0 && with_transmute < 2; with_transmute++) { for (i = 0; diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index 73875a60a3..0c1f98d756 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -1124,6 +1124,15 @@ gtk_selection_convert (GtkWidget *widget, display = gtk_widget_get_display (widget); owner_window = gdk_selection_owner_get_for_display (display, selection); +#ifdef GDK_WINDOWING_WIN32 + /* Special handling for DELETE requests, + * make sure this goes down into GDK layer. + */ + if (GDK_IS_WIN32_DISPLAY (display) && + target == gdk_atom_intern_static_string ("DELETE")) + owner_window = NULL; +#endif + if (owner_window != NULL) { GtkWidget *owner_widget;