It was unused.
GdkContentFormats *targets;
GdkEventSequence *sequence;
GdkEvent *last_event;
- guint button;
if (!priv->in_drag)
return;
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
last_event = gdk_event_copy (gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence));
- button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
gtk_event_controller_reset (GTK_EVENT_CONTROLLER (gesture));
targets = gdk_content_formats_new (NULL, 0);
targets = gtk_content_formats_add_text_targets (targets);
context = gtk_drag_begin_with_coordinates (widget, targets, GDK_ACTION_COPY,
- button, last_event,
+ last_event,
start_x, start_y);
priv->in_drag = 0;
guint32 time);
/* Forward declarations */
-static void gtk_drag_get_event_actions (const GdkEvent *event,
- gint button,
- GdkDragAction actions,
- GdkDragAction *suggested_action,
- GdkDragAction *possible_actions);
static GtkWidget *gtk_drag_get_ipc_widget (GtkWidget *widget);
static GtkWidget *gtk_drag_get_ipc_widget_for_display(GdkDisplay*display);
static void gtk_drag_release_ipc_widget (GtkWidget *widget);
drag_widgets);
}
-static void
-gtk_drag_get_event_actions (const GdkEvent *event,
- gint button,
- GdkDragAction actions,
- GdkDragAction *suggested_action,
- GdkDragAction *possible_actions)
-{
- *suggested_action = 0;
- *possible_actions = 0;
-
- if (event)
- {
- GdkModifierType state = 0;
-
- gdk_event_get_state (event, &state);
-
- if ((button == GDK_BUTTON_MIDDLE || button == GDK_BUTTON_SECONDARY) && (actions & GDK_ACTION_ASK))
- {
- *suggested_action = GDK_ACTION_ASK;
- *possible_actions = actions;
- }
- else if (state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK))
- {
- if ((state & GDK_SHIFT_MASK) && (state & GDK_CONTROL_MASK))
- {
- if (actions & GDK_ACTION_LINK)
- {
- *suggested_action = GDK_ACTION_LINK;
- *possible_actions = GDK_ACTION_LINK;
- }
- }
- else if (state & GDK_CONTROL_MASK)
- {
- if (actions & GDK_ACTION_COPY)
- {
- *suggested_action = GDK_ACTION_COPY;
- *possible_actions = GDK_ACTION_COPY;
- }
- }
- else
- {
- if (actions & GDK_ACTION_MOVE)
- {
- *suggested_action = GDK_ACTION_MOVE;
- *possible_actions = GDK_ACTION_MOVE;
- }
- }
- }
- else
- {
- *possible_actions = actions;
-
- if ((state & (GDK_MOD1_MASK)) && (actions & GDK_ACTION_ASK))
- *suggested_action = GDK_ACTION_ASK;
- else if (actions & GDK_ACTION_COPY)
- *suggested_action = GDK_ACTION_COPY;
- else if (actions & GDK_ACTION_MOVE)
- *suggested_action = GDK_ACTION_MOVE;
- else if (actions & GDK_ACTION_LINK)
- *suggested_action = GDK_ACTION_LINK;
- }
- }
- else
- {
- *possible_actions = actions;
-
- if (actions & GDK_ACTION_COPY)
- *suggested_action = GDK_ACTION_COPY;
- else if (actions & GDK_ACTION_MOVE)
- *suggested_action = GDK_ACTION_MOVE;
- else if (actions & GDK_ACTION_LINK)
- *suggested_action = GDK_ACTION_LINK;
- }
-}
-
/********************
* Destination side *
********************/
GtkImageDefinition *icon,
GdkContentFormats *target_list,
GdkDragAction actions,
- gint button,
const GdkEvent *event,
int x,
int y)
{
GtkDragSourceInfo *info;
guint32 time = GDK_CURRENT_TIME;
- GdkDragAction possible_actions, suggested_action;
GdkDragContext *context;
GtkWidget *ipc_widget;
GdkDevice *pointer;
ipc_widget = gtk_drag_get_ipc_widget (widget);
- gtk_drag_get_event_actions (event, button, actions,
- &suggested_action, &possible_actions);
-
if (event)
{
time = gdk_event_get_time (event);
* @targets: The targets (data formats) in which the
* source can provide the data
* @actions: A bitmask of the allowed drag actions for this drag
- * @button: The button the user clicked to start the drag
* @event: (nullable): The event that triggered the start of the drag,
* or %NULL if none can be obtained.
* @x: The initial x coordinate to start dragging from, in the coordinate space
gtk_drag_begin_with_coordinates (GtkWidget *widget,
GdkContentFormats *targets,
GdkDragAction actions,
- gint button,
GdkEvent *event,
gint x,
gint y)
g_return_val_if_fail (targets != NULL, NULL);
return gtk_drag_begin_internal (widget, NULL, targets,
- actions, button, event, x, y);
+ actions, event, x, y);
}
static void
GdkDragContext *gtk_drag_begin_with_coordinates (GtkWidget *widget,
GdkContentFormats *targets,
GdkDragAction actions,
- gint button,
GdkEvent *event,
gint x,
gint y);
GtkImageDefinition *icon,
GdkContentFormats *target_list,
GdkDragAction actions,
- gint button,
const GdkEvent *event,
int x,
int y);
{
GdkEventSequence *sequence;
GdkEvent *last_event;
- guint button;
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (site->drag_gesture));
last_event = gdk_event_copy (gtk_gesture_get_last_event (site->drag_gesture, sequence));
- button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (site->drag_gesture));
gtk_event_controller_reset (GTK_EVENT_CONTROLLER (site->drag_gesture));
gtk_drag_begin_internal (widget, site->image_def, site->target_list,
- site->actions, button, last_event,
+ site->actions, last_event,
start_x, start_y);
gdk_event_free (last_event);
gtk_drag_begin_with_coordinates (widget,
icon_info->target_list,
icon_info->actions,
- 1,
event,
priv->start_x,
priv->start_y);
gint n_ranges;
GdkContentFormats *target_list = gdk_content_formats_new (NULL, 0);
guint actions = priv->editable ? GDK_ACTION_COPY | GDK_ACTION_MOVE : GDK_ACTION_COPY;
- guint button;
target_list = gtk_content_formats_add_text_targets (target_list);
gtk_entry_get_pixel_ranges (entry, &ranges, &n_ranges);
- button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
gtk_drag_begin_with_coordinates (widget, target_list, actions,
- button, (GdkEvent*) event,
+ (GdkEvent*) event,
priv->drag_start_x + ranges[0],
priv->drag_start_y);
g_free (ranges);
GtkWidget *widget = GTK_WIDGET (icon_view);
GdkDragContext *context;
GtkTreePath *path = NULL;
- gint button;
GtkTreeModel *model;
gboolean retval = FALSE;
gdouble x, y;
if (model == NULL)
goto out;
- button = icon_view->priv->pressed_button;
icon_view->priv->pressed_button = -1;
path = gtk_icon_view_get_path_at_pos (icon_view,
context = gtk_drag_begin_with_coordinates (widget,
gtk_drag_source_get_target_list (widget),
icon_view->priv->source_actions,
- button,
(GdkEvent*)event,
icon_view->priv->press_start_x,
icon_view->priv->press_start_y);
G_CALLBACK (drag_begin_cb), NULL);
gtk_drag_begin_with_coordinates (widget, target_list,
GDK_ACTION_COPY,
- 1, (GdkEvent*) event,
+ (GdkEvent*) event,
info->drag_start_x,
info->drag_start_y);
priv->detached_tab = priv->cur_page;
gtk_drag_begin_with_coordinates (widget, priv->source_targets, GDK_ACTION_MOVE,
- priv->pressed_button, (GdkEvent*) event,
+ (GdkEvent*) event,
priv->drag_begin_x, priv->drag_begin_y);
return TRUE;
}
sidebar->dragging_over = TRUE;
gtk_drag_begin_with_coordinates (widget, sidebar->source_targets, GDK_ACTION_MOVE,
- GDK_BUTTON_PRIMARY, (GdkEvent*)event,
+ (GdkEvent*)event,
-1, -1);
}
G_CALLBACK (drag_begin_cb), NULL);
gtk_drag_begin_with_coordinates (GTK_WIDGET (text_view), formats,
GDK_ACTION_COPY | GDK_ACTION_MOVE,
- 1, (GdkEvent*) event, x, y);
+ (GdkEvent*) event, x, y);
}
static void
context = gtk_drag_begin_with_coordinates (widget,
gtk_drag_source_get_target_list (widget),
di->source_actions,
- button,
(GdkEvent*)event,
start_x, start_y);