treeview: Use widget coordinates where required
authorMat <mail@mathias.is>
Wed, 10 Aug 2022 01:09:48 +0000 (04:09 +0300)
committerMat <mail@mathias.is>
Wed, 10 Aug 2022 01:25:19 +0000 (04:25 +0300)
When a GtkTreeView scrolled horizontally, it was not possible to
select rows outside the initial area due to an erroneous comparison
between widget and bin window coordinates.

Original change to widget coordinates occurred in commit
a0de570e47228094f430fcade4e6f56eb75bd8f5

gtk/gtktreeview.c

index dc152898fdd8ca56cdc745f4ec4e2e3caa53fde3..505cf92b990cce8231c4b23207950ee39689fce5 100644 (file)
@@ -2835,8 +2835,8 @@ gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture,
         continue;
 
       background_area.width = gtk_tree_view_column_get_width (candidate);
-      if ((background_area.x > bin_x) ||
-          (background_area.x + background_area.width <= bin_x))
+      if ((background_area.x > x) ||
+          (background_area.x + background_area.width <= x))
         {
           background_area.x += background_area.width;
           continue;
@@ -2942,7 +2942,7 @@ gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture,
       focus_cell = _gtk_tree_view_column_get_cell_at_pos (column,
                                                           &cell_area,
                                                           &background_area,
-                                                          bin_x, bin_y);
+                                                          x, y);
 
       if (focus_cell)
         gtk_tree_view_column_focus_cell (column, focus_cell);