summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-07-04 08:40:49 +0200
committerMatthias Clasen <mclasen@redhat.com>2018-07-12 13:02:42 +0200
commita756caa1062ef8111321c4bc516136e1ca5aa1cd (patch)
tree742ef67d3930ceef2f76a497b999c3ce58f85ef3
parentda22ba3b867ff2a3899ebc791a53a6b2b2e50478 (diff)
downloadgtk+-a756caa1062ef8111321c4bc516136e1ca5aa1cd.tar.gz
dnd: Drop suggested_action
The only user of this field was the x11 backend, and it turns out that it does not need to store the value at all.
-rw-r--r--gdk/gdkdrag.c26
-rw-r--r--gdk/gdkdrag.h2
-rw-r--r--gdk/gdkdragprivate.h3
-rw-r--r--gdk/x11/gdkdnd-x11.c14
4 files changed, 8 insertions, 37 deletions
diff --git a/gdk/gdkdrag.c b/gdk/gdkdrag.c
index ff8472d259..58878c9076 100644
--- a/gdk/gdkdrag.c
+++ b/gdk/gdkdrag.c
@@ -130,8 +130,7 @@ gdk_drag_get_formats (GdkDrag *drag)
* gdk_drag_get_actions:
* @drag: a #GdkDrag
*
- * Determines the bitmask of actions proposed by the source if
- * gdk_drag_get_suggested_action() returns %GDK_ACTION_ASK.
+ * Determines the bitmask of possible actions proposed by the source.
*
* Returns: the #GdkDragAction flags
**/
@@ -144,22 +143,6 @@ gdk_drag_get_actions (GdkDrag *drag)
}
/**
- * gdk_drag_get_suggested_action:
- * @drag: a #GdkDrag
- *
- * Determines the suggested drag action of the GdkDrag object.
- *
- * Returns: a #GdkDragAction value
- **/
-GdkDragAction
-gdk_drag_get_suggested_action (GdkDrag *drag)
-{
- g_return_val_if_fail (GDK_IS_DRAG (drag), 0);
-
- return drag->suggested_action;
-}
-
-/**
* gdk_drag_get_selected_action:
* @drag: a #GdkDrag
*
@@ -621,13 +604,6 @@ 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/gdkdrag.h b/gdk/gdkdrag.h
index dd24c72fb1..984fc80995 100644
--- a/gdk/gdkdrag.h
+++ b/gdk/gdkdrag.h
@@ -66,8 +66,6 @@ GdkContentFormats *gdk_drag_get_formats (GdkDrag *drag);
GDK_AVAILABLE_IN_ALL
GdkDragAction gdk_drag_get_actions (GdkDrag *drag);
GDK_AVAILABLE_IN_ALL
-GdkDragAction gdk_drag_get_suggested_action (GdkDrag *drag);
-GDK_AVAILABLE_IN_ALL
GdkDragAction gdk_drag_get_selected_action (GdkDrag *drag);
GDK_AVAILABLE_IN_ALL
diff --git a/gdk/gdkdragprivate.h b/gdk/gdkdragprivate.h
index 71dca2a888..8aa3f9bf70 100644
--- a/gdk/gdkdragprivate.h
+++ b/gdk/gdkdragprivate.h
@@ -70,7 +70,6 @@ struct _GdkDrag {
GdkDragAction actions;
GdkDragAction selected_action;
- GdkDragAction suggested_action;
guint drop_done : 1; /* Whether gdk_drag_drop_done() was performed */
};
@@ -79,8 +78,6 @@ void gdk_drag_set_cursor (GdkDrag *drag,
GdkCursor *cursor);
void gdk_drag_set_actions (GdkDrag *drag,
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 e6b410efa0..f42b133fa0 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -1478,7 +1478,6 @@ gdk_x11_drag_drag_motion (GdkDrag *drag,
move_drag_surface (drag, x_root, y_root);
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)
{
@@ -1582,7 +1581,7 @@ gdk_x11_drag_drag_motion (GdkDrag *drag,
*/
if (gdk_content_formats_contain_mime_type (formats, "application/x-rootwindow-drop") ||
gdk_content_formats_contain_mime_type (formats, "application/x-rootwin-drop"))
- gdk_drag_set_selected_action (drag, gdk_drag_get_suggested_action (drag));
+ gdk_drag_set_selected_action (drag, suggested_action);
else
gdk_drag_set_selected_action (drag, 0);
@@ -2248,19 +2247,20 @@ gdk_drag_update (GdkDrag *drag,
guint32 evtime)
{
GdkX11Drag *x11_drag = GDK_X11_DRAG (drag);
- GdkDragAction action, possible_actions;
+ GdkDragAction suggested_action;
+ GdkDragAction possible_actions;
GdkDragProtocol protocol;
Window proxy;
gdk_drag_get_current_actions (mods, GDK_BUTTON_PRIMARY, x11_drag->actions,
- &action, &possible_actions);
+ &suggested_action, &possible_actions);
proxy = gdk_x11_drag_find_surface (drag,
- x11_drag->drag_surface,
- x_root, y_root, &protocol);
+ x11_drag->drag_surface,
+ x_root, y_root, &protocol);
gdk_x11_drag_drag_motion (drag, proxy, protocol, x_root, y_root,
- action, possible_actions, evtime);
+ suggested_action, possible_actions, evtime);
}
static gboolean