summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-07-04 08:32:27 +0200
committerMatthias Clasen <mclasen@redhat.com>2018-07-12 13:02:42 +0200
commitda22ba3b867ff2a3899ebc791a53a6b2b2e50478 (patch)
tree6f2a3bed05ba91910ae91f817a0d5f8b8b7da549
parent7a0a92f2b6dda00b4e60184d0ffd2d0e994fad6b (diff)
downloadgtk+-da22ba3b867ff2a3899ebc791a53a6b2b2e50478.tar.gz
drag: Split a setter
In preparation for moving the suggested action to the x11 backend, split the setter off.
-rw-r--r--gdk/gdkdrag.c14
-rw-r--r--gdk/gdkdragprivate.h3
-rw-r--r--gdk/x11/gdkdnd-x11.c3
3 files changed, 13 insertions, 7 deletions
diff --git a/gdk/gdkdrag.c b/gdk/gdkdrag.c
index 63c76153f7..ff8472d259 100644
--- a/gdk/gdkdrag.c
+++ b/gdk/gdkdrag.c
@@ -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;
@@ -624,6 +621,13 @@ gdk_drag_set_actions (GdkDrag *drag,
}
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)
{
diff --git a/gdk/gdkdragprivate.h b/gdk/gdkdragprivate.h
index 835dd26807..71dca2a888 100644
--- a/gdk/gdkdragprivate.h
+++ b/gdk/gdkdragprivate.h
@@ -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);
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index b45542ff4a..e6b410efa0 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -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)
{