diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-11-30 05:33:41 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-11-30 07:15:35 +0800 |
commit | d52ad1054d509bbe02809b7f5a9471e95727ef08 (patch) | |
tree | 6db76f4f0919e05eec1813f3020e144c936f8773 /addressbook | |
parent | 1d3ccfb8e6ee69403eb6237692222a112e7b400d (diff) | |
download | gsoc2013-evolution-d52ad1054d509bbe02809b7f5a9471e95727ef08.tar gsoc2013-evolution-d52ad1054d509bbe02809b7f5a9471e95727ef08.tar.gz gsoc2013-evolution-d52ad1054d509bbe02809b7f5a9471e95727ef08.tar.bz2 gsoc2013-evolution-d52ad1054d509bbe02809b7f5a9471e95727ef08.tar.lz gsoc2013-evolution-d52ad1054d509bbe02809b7f5a9471e95727ef08.tar.xz gsoc2013-evolution-d52ad1054d509bbe02809b7f5a9471e95727ef08.tar.zst gsoc2013-evolution-d52ad1054d509bbe02809b7f5a9471e95727ef08.zip |
Add a GdkDevice parameter to gnome_canvas_item_grab().
GnomeCanvas will stash the GdkDevice and reuse it in the subsequent
gnome_canvas_item_ungrab() call.
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 4e0df4c42f..b0dae34b69 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -580,17 +580,28 @@ e_minicard_event (GnomeCanvasItem *item, case GDK_BUTTON_PRESS: { if (1 <= event->button.button && event->button.button <= 2) { gint ret_val = e_minicard_selected (e_minicard, event); - GdkEventMask mask = ((1 << (4 + event->button.button)) | - GDK_POINTER_MOTION_MASK | - GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK); + GdkGrabStatus grab_status; + GdkDevice *event_device; + guint32 event_time; e_canvas_item_grab_focus (item, TRUE); - if (gnome_canvas_item_grab (GNOME_CANVAS_ITEM (e_minicard), - mask, NULL, event->button.time)) { + event_device = gdk_event_get_device (event); + event_time = gdk_event_get_time (event); + + grab_status = gnome_canvas_item_grab ( + GNOME_CANVAS_ITEM (e_minicard), + (1 << (4 + event->button.button)) | + GDK_POINTER_MOTION_MASK | + GDK_BUTTON_PRESS_MASK | + GDK_BUTTON_RELEASE_MASK, + NULL, + event_device, + event_time); + + if (grab_status != GDK_GRAB_SUCCESS) return FALSE; - } + gtk_grab_add (GTK_WIDGET (GNOME_CANVAS_ITEM (e_minicard)->canvas)); e_minicard->button_x = event->button.x; e_minicard->button_y = event->button.y; |