diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2016-01-21 15:21:16 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2016-01-22 21:18:24 +0100 |
commit | a5f9dc12849b1b2efcc5c452fef5e3d99c70a172 (patch) | |
tree | 35b602924c769c25209852fca028bb6943173db3 | |
parent | 0a9e9db9f4a8b81d3dda6b7d739b0fb003a642c1 (diff) | |
download | gtk+-a5f9dc12849b1b2efcc5c452fef5e3d99c70a172.tar.gz |
GtkTreeView: Avoid device query on collapsing rows
The pointer position is queried to properly trigger the prelight
updates on the new row below it. We store the last coordinates
though, and track crossing events to unset these, so it's safe
to just update_prelight() here on these.
-rw-r--r-- | gtk/gtktreeview.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index c17bddfe8d..b0688e31a5 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -12893,9 +12893,7 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, GtkTreeIter iter; GtkTreeIter children; gboolean collapse; - gint x, y; GList *list; - GdkWindow *child; gboolean selection_changed, cursor_changed; if (animate) @@ -13004,22 +13002,9 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view, g_signal_emit (tree_view, tree_view_signals[ROW_COLLAPSED], 0, &iter, path); if (gtk_widget_get_mapped (GTK_WIDGET (tree_view))) - { - GdkSeat *seat; - - seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (tree_view))); - /* now that we've collapsed all rows, we want to try to set the prelight again */ - child = gdk_window_get_device_position (gdk_window_get_parent (tree_view->priv->bin_window), - gdk_seat_get_pointer (seat), - &x, &y, NULL); - if (child == tree_view->priv->bin_window) - { - y = MAX (0, TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, y)); - - _gtk_rbtree_find_offset (tree_view->priv->tree, y, &tree, &node); - prelight_or_select (tree_view, tree_view->priv->tree, node, x, y); - } - } + update_prelight (tree_view, + tree_view->priv->event_last_x, + tree_view->priv->event_last_y); return TRUE; } |