Commit cd18d19d authored by Theo Linkspfeifer's avatar Theo Linkspfeifer Committed by Alexander Schwinn

Restore right-click drag and drop functionality (Bug #14583)

parent 29a6fb74
......@@ -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;
......
......@@ -3081,6 +3081,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);
......@@ -3092,10 +3094,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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment