treeview: ask the X server for the pointer while drawing only for an expander arrow that is held down, not on every expose with expanders

This commit is contained in:
Daemonratte 2026-10-16 14:06:25 +02:00
commit 7caf2e02b1
No known key found for this signature in database

View file

@ -4351,7 +4351,7 @@ gtk_tree_view_bin_expose (GtkWidget *widget,
gboolean has_special_cell;
gboolean rtl;
gint n_visible_columns;
gint pointer_x, pointer_y;
gint pointer_x = 0, pointer_y = 0;
gint grid_line_width;
gboolean got_pointer = FALSE;
gboolean row_ending_details;
@ -4722,7 +4722,9 @@ gtk_tree_view_bin_expose (GtkWidget *widget,
if (TREE_VIEW_DRAW_EXPANDERS(tree_view)
&& (node->flags & GTK_RBNODE_IS_PARENT) == GTK_RBNODE_IS_PARENT)
{
if (!got_pointer)
/* the pointer only matters for the arrow being pressed;
* asking for it is a round trip to the server */
if (!got_pointer && node == tree_view->priv->button_pressed_node)
{
gdk_window_get_pointer (tree_view->priv->bin_window,
&pointer_x, &pointer_y, NULL);