Only register application/x-rootwindow-drop on X11

application/x-rootwindow-drop is not useful anywhere else,
so put it under #ifdef GDK_WINDOWING_X11

On W32 this prevents toplevels from automatically becoming valid
drop targets with a useless drop type.

(This commit is cherry-picked from the gtk-3-22 branch)

https://bugzilla.gnome.org/show_bug.cgi?id=786509
This commit is contained in:
Руслан Ижбулатов 2017-08-15 13:07:01 +00:00
parent 33de691d9f
commit 6a770517cc

View File

@ -277,9 +277,11 @@ struct _GtkWindowPrivate
GList *foci;
};
#ifdef GDK_WINDOWING_X11
static const char *dnd_dest_targets [] = {
"application/x-rootwindow-drop"
};
#endif
enum {
SET_FOCUS,
@ -1909,12 +1911,14 @@ gtk_window_init (GtkWindow *window)
priv->scale = gtk_widget_get_scale_factor (widget);
#ifdef GDK_WINDOWING_X11
targets = gdk_content_formats_new (dnd_dest_targets, G_N_ELEMENTS (dnd_dest_targets));
gtk_drag_dest_set (GTK_WIDGET (window),
GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
targets,
GDK_ACTION_MOVE);
gdk_content_formats_unref (targets);
#endif
seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
g_signal_connect (seat, "device-removed",