diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c index d9147aa7118d3b66d161f9dcafe7e84f13f5ef5c..4299862d7ea4c83bcfe430101cbf34e12b7b05fa 100644 --- a/thunar/thunar-file.c +++ b/thunar/thunar-file.c @@ -2031,11 +2031,18 @@ thunar_file_accepts_drop (ThunarFile *file, /* default to whatever GTK+ thinks for the suggested action */ suggested_action = gdk_drag_context_get_suggested_action (context); + /* get the possible actions */ + actions = gdk_drag_context_get_actions (context); + + /* when the option to ask the user is set, make it the preferred action */ + if (G_UNLIKELY ((actions & GDK_ACTION_ASK) != 0)) + suggested_action = GDK_ACTION_ASK; + /* check if we have a writable directory here or an executable file */ if (thunar_file_is_directory (file) && thunar_file_is_writable (file)) { /* determine the possible actions */ - actions = gdk_drag_context_get_actions (context) & (GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK); + actions &= (GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK); /* cannot create symbolic links in the trash or copy to the trash */ if (thunar_file_is_trashed (file)) @@ -2113,7 +2120,7 @@ thunar_file_accepts_drop (ThunarFile *file, else if (thunar_file_is_executable (file)) { /* determine the possible actions */ - actions = gdk_drag_context_get_actions (context) & (GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_PRIVATE); + actions &= (GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_PRIVATE); } else return 0; diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c index 9b3d8b33b631c9c4db1220e6c2f4a7b308f118f9..0853d6cf06771b8677295003482c3d503c448813 100644 --- a/thunar/thunar-standard-view.c +++ b/thunar/thunar-standard-view.c @@ -3106,6 +3106,8 @@ thunar_standard_view_motion_notify_event (GtkWidget *view, GdkEventMotion *event, ThunarStandardView *standard_view) { + GtkTargetList *target_list; + _thunar_return_val_if_fail (THUNAR_IS_STANDARD_VIEW (standard_view), FALSE); _thunar_return_val_if_fail (standard_view->priv->drag_timer_id != 0, FALSE); @@ -3117,10 +3119,16 @@ thunar_standard_view_motion_notify_event (GtkWidget *view, gdk_event_free (standard_view->priv->drag_timer_event); standard_view->priv->drag_timer_event = NULL; - /* FIXME - * - according to doc, the GdkWindow associated to the widget needs to enable the GDK_POINTER_MOTION_MASK mask to use this event. - * We dont do that. So possibly this is dead code, which can be removed ? - */ + /* allocate the drag context */ + target_list = gtk_target_list_new (drag_targets, G_N_ELEMENTS (drag_targets)); + gtk_drag_begin_with_coordinates (view, target_list, + GDK_ACTION_COPY | + GDK_ACTION_MOVE | + GDK_ACTION_LINK | + GDK_ACTION_ASK, + 3, (GdkEvent *) event, -1, -1); + gtk_target_list_unref (target_list); + return TRUE; }