summaryrefslogtreecommitdiff
path: root/gtk/gtktreeview.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-11-17 14:40:52 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2020-11-17 16:38:12 +0000
commit153c6424d3aa983c3679a7ebf640d0b2b21fc26a (patch)
tree95ad303259c619d3497b9d1452658472ada66182 /gtk/gtktreeview.c
parent2b8c3731c1803228b5df1238015c6d971a57fa35 (diff)
downloadgtk+-ebassi/inout-args.tar.gz
Remove pointless inout argumentsebassi/inout-args
GtkTreeView.get_tooltip_context() takes an inout X and Y coordinates, but the "out" side is a side effect: the conversion from widget-relative to bin window-relative coordinates is not documented, and can be done using public API, if needed. GtkIconView.get_tooltip_context() follows the same pattern, and takes two inout arguments for the coordinates, but it does not change them any more, after GtkIconView's bin window was dropped in commit 8dc5e13e. There's really no point in having these `inout` arguments, and while GtkTreeView and GtkIconView are certainly de-emphasised in GTK4, and we nudge developers to move to the new list views, we should take advantage of the API break to remove warts.
Diffstat (limited to 'gtk/gtktreeview.c')
-rw-r--r--gtk/gtktreeview.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 8cfb238deb..f404eec9e4 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -14676,8 +14676,8 @@ gtk_tree_view_set_tooltip_cell (GtkTreeView *tree_view,
/**
* gtk_tree_view_get_tooltip_context:
* @tree_view: a #GtkTreeView
- * @x: (inout): the x coordinate (relative to widget coordinates)
- * @y: (inout): the y coordinate (relative to widget coordinates)
+ * @x: the x coordinate (relative to widget coordinates)
+ * @y: the y coordinate (relative to widget coordinates)
* @keyboard_tip: whether this is a keyboard tooltip or not
* @model: (out) (optional) (nullable) (transfer none): a pointer to
* receive a #GtkTreeModel or %NULL
@@ -14700,8 +14700,8 @@ gtk_tree_view_set_tooltip_cell (GtkTreeView *tree_view,
*/
gboolean
gtk_tree_view_get_tooltip_context (GtkTreeView *tree_view,
- int *x,
- int *y,
+ int x,
+ int y,
gboolean keyboard_tip,
GtkTreeModel **model,
GtkTreePath **path,
@@ -14710,8 +14710,6 @@ gtk_tree_view_get_tooltip_context (GtkTreeView *tree_view,
GtkTreePath *tmppath = NULL;
g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE);
- g_return_val_if_fail (x != NULL, FALSE);
- g_return_val_if_fail (y != NULL, FALSE);
if (keyboard_tip)
{
@@ -14722,10 +14720,12 @@ gtk_tree_view_get_tooltip_context (GtkTreeView *tree_view,
}
else
{
- gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, *x, *y,
- x, y);
+ int rel_x, rel_y;
- if (!gtk_tree_view_get_path_at_pos (tree_view, *x, *y,
+ gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y,
+ &rel_x, &rel_y);
+
+ if (!gtk_tree_view_get_path_at_pos (tree_view, rel_x, rel_y,
&tmppath, NULL, NULL, NULL))
return FALSE;
}
@@ -14762,7 +14762,7 @@ gtk_tree_view_set_tooltip_query_cb (GtkWidget *widget,
GtkTreeViewPrivate *priv = gtk_tree_view_get_instance_private (tree_view);
if (!gtk_tree_view_get_tooltip_context (GTK_TREE_VIEW (widget),
- &x, &y,
+ x, y,
keyboard_tip,
&model, &path, &iter))
return FALSE;