[gtk+] gtktreeview: Transform cell area to widget coordinates



commit a0de570e47228094f430fcade4e6f56eb75bd8f5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Oct 6 18:12:03 2017 +0200

    gtktreeview: Transform cell area to widget coordinates
    
    GtkCellArea uses event coordinates (thus in treeview relative
    coordinates), but calculations used to happen in bin window coords.
    We can just offset the cell area by the bin window, fixes cell
    renderer activation and edition.

 gtk/gtktreeview.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 315a5d7..2bb539c 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2900,6 +2900,12 @@ gtk_tree_view_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
   background_area.height = gtk_tree_view_get_row_height (tree_view, node);
   background_area.x = 0;
 
+  gtk_tree_view_convert_bin_window_to_widget_coords (tree_view,
+                                                     background_area.x,
+                                                     background_area.y,
+                                                     &background_area.x,
+                                                     &background_area.y);
+
   /* Let the column have a chance at selecting it. */
   rtl = (_gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
   for (list = (rtl ? g_list_last (tree_view->priv->columns) : g_list_first (tree_view->priv->columns));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]