[balsa/wip/gtk4: 15/351] Fix tree coords



commit 3e0eba7135914b2c1ef1729c2237621051766ca3
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Oct 4 23:18:42 2017 -0400

    Fix tree coords

 src/balsa-mblist.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/balsa-mblist.c b/src/balsa-mblist.c
index d82bfbe..193978b 100644
--- a/src/balsa-mblist.c
+++ b/src/balsa-mblist.c
@@ -872,6 +872,7 @@ bmbl_select_mailbox(GtkTreeSelection * selection, gpointer data)
     GtkTreePath *path;
     guint button;
     gdouble x_win, y_win;
+    gint tx, ty;
 
     if (!event) {
        GtkTreeIter iter;
@@ -902,9 +903,10 @@ bmbl_select_mailbox(GtkTreeSelection * selection, gpointer data)
         return;
     }
 
-    if (!gtk_tree_view_get_path_at_pos(tree_view, (gint) x_win,
-                                       (gint) y_win, &path,
-                                       NULL, NULL, NULL)) {
+    gtk_tree_view_convert_widget_to_tree_coords(tree_view, (gint) x_win, (gint) y_win,
+                                                &tx, &ty);
+
+    if (!gtk_tree_view_get_path_at_pos(tree_view, tx, ty, &path, NULL, NULL, NULL)) {
         /* GtkTreeView selects the first node in the tree when the
          * widget first gets the focus, whether it's a keyboard event or
          * a button event. If it's a button event, but no mailbox was
@@ -916,8 +918,7 @@ bmbl_select_mailbox(GtkTreeSelection * selection, gpointer data)
         return;
     }
 
-    /* if (gtk_tree_selection_path_is_selected(selection, path)) */
-    {
+    if (gtk_tree_selection_path_is_selected(selection, path)) {
         BalsaMailboxNode *mbnode;
         GtkTreeIter iter;
 


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