drag: Split a setter

In preparation for moving the suggested action
to the x11 backend, split the setter off.
This commit is contained in:
Matthias Clasen 2018-07-04 08:32:27 +02:00
parent 7a0a92f2b6
commit da22ba3b86
3 changed files with 13 additions and 7 deletions

View File

@ -249,7 +249,7 @@ gdk_drag_set_property (GObject *gobject,
case PROP_ACTIONS:
{
GdkDragAction actions = g_value_get_flags (value);
gdk_drag_set_actions (drag, actions, drag->suggested_action);
gdk_drag_set_actions (drag, actions);
}
break;
@ -610,11 +610,8 @@ gdk_drag_write_finish (GdkDrag *drag,
void
gdk_drag_set_actions (GdkDrag *drag,
GdkDragAction actions,
GdkDragAction suggested_action)
GdkDragAction actions)
{
drag->suggested_action = suggested_action;
if (drag->actions == actions)
return;
@ -623,6 +620,13 @@ gdk_drag_set_actions (GdkDrag *drag,
g_object_notify_by_pspec (G_OBJECT (drag), properties[PROP_ACTIONS]);
}
void
gdk_drag_set_suggested_action (GdkDrag *drag,
GdkDragAction suggested_action)
{
drag->suggested_action = suggested_action;
}
void
gdk_drag_set_selected_action (GdkDrag *drag,
GdkDragAction action)

View File

@ -78,7 +78,8 @@ struct _GdkDrag {
void gdk_drag_set_cursor (GdkDrag *drag,
GdkCursor *cursor);
void gdk_drag_set_actions (GdkDrag *drag,
GdkDragAction actions,
GdkDragAction actions);
void gdk_drag_set_suggested_action (GdkDrag *drag,
GdkDragAction suggested_action);
void gdk_drag_set_selected_action (GdkDrag *drag,
GdkDragAction action);

View File

@ -1477,7 +1477,8 @@ gdk_x11_drag_drag_motion (GdkDrag *drag,
if (drag_x11->drag_surface)
move_drag_surface (drag, x_root, y_root);
gdk_drag_set_actions (drag, possible_actions, suggested_action);
gdk_drag_set_actions (drag, possible_actions);
gdk_drag_set_suggested_action (drag, suggested_action);
if (protocol == GDK_DRAG_PROTO_XDND && drag_x11->version == 0)
{