[evolution] Bug 764172 - Do not grab mouse on left-click in message list



commit f7fa6d91bbfb27614d1cd378d85cfb56e200e41d
Author: Milan Crha <mcrha redhat com>
Date:   Thu Mar 31 19:25:13 2016 +0200

    Bug 764172 - Do not grab mouse on left-click in message list

 e-util/e-table-item.c |   19 +++++++++----------
 e-util/e-table-item.h |    2 +-
 2 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/e-util/e-table-item.c b/e-util/e-table-item.c
index 1715b91..f2bbad6 100644
--- a/e-util/e-table-item.c
+++ b/e-util/e-table-item.c
@@ -288,8 +288,14 @@ eti_ungrab (ETableItem *eti,
             guint32 time)
 {
        GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti);
+       gboolean was_grabbed;
+
        d (g_print ("%s: time: %d\n", G_STRFUNC, time));
-       eti->grabbed_count--;
+
+       was_grabbed = eti->grabbed_count > 0;
+       if (was_grabbed)
+               eti->grabbed_count--;
+
        if (eti->grabbed_count == 0) {
                if (eti->grab_cancelled) {
                        eti->grab_cancelled = FALSE;
@@ -299,7 +305,8 @@ eti_ungrab (ETableItem *eti,
                                gtk_grab_remove (GTK_WIDGET (item->canvas));
                                eti->gtk_grabbed = FALSE;
                        }
-                       gnome_canvas_item_ungrab (item, time);
+                       if (was_grabbed)
+                               gnome_canvas_item_ungrab (item, time);
                        eti->grabbed_col = -1;
                        eti->grabbed_row = -1;
                }
@@ -1762,7 +1769,6 @@ e_table_item_init (ETableItem *eti)
 
        eti->in_drag = 0;
        eti->maybe_in_drag = 0;
-       eti->grabbed = 0;
 
        eti->grabbed_col = -1;
        eti->grabbed_row = -1;
@@ -2506,21 +2512,14 @@ eti_event (GnomeCanvasItem *item,
                        }
 
                        if (event_button == 1) {
-                               GdkDevice *event_device;
-
                                return_val = TRUE;
 
-                               event_device = gdk_event_get_device (event);
-
                                eti->maybe_in_drag = TRUE;
                                eti->drag_row = new_cursor_row;
                                eti->drag_col = new_cursor_col;
                                eti->drag_x = event_x_item;
                                eti->drag_y = event_y_item;
                                eti->drag_state = event_state;
-                               eti->grabbed = TRUE;
-                               d (g_print ("%s: eti_grab\n", G_STRFUNC));
-                               eti_grab (eti, event_device, event_time);
                        }
 
                        break;
diff --git a/e-util/e-table-item.h b/e-util/e-table-item.h
index 2ed1f9e..c0cac9e 100644
--- a/e-util/e-table-item.h
+++ b/e-util/e-table-item.h
@@ -115,7 +115,7 @@ struct _ETableItem {
 
        guint maybe_in_drag : 1;
        guint in_drag : 1;
-       guint grabbed : 1;
+       guint unused__grabbed : 1; /* this one is not used in the code */
 
        guint maybe_did_something : 1;
 


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