diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-09-18 09:40:20 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-09-18 09:40:20 +0800 |
commit | d4bf3e01bc44d7d8471251e2e890ce0e0ca07113 (patch) | |
tree | 308132504f4a34bb701dc842ead7093e35751166 /addressbook/gui/widgets/e-minicard.c | |
parent | 999889586bbb251669c5a384f1b5d03bd72d0a6d (diff) | |
download | gsoc2013-evolution-d4bf3e01bc44d7d8471251e2e890ce0e0ca07113.tar gsoc2013-evolution-d4bf3e01bc44d7d8471251e2e890ce0e0ca07113.tar.gz gsoc2013-evolution-d4bf3e01bc44d7d8471251e2e890ce0e0ca07113.tar.bz2 gsoc2013-evolution-d4bf3e01bc44d7d8471251e2e890ce0e0ca07113.tar.lz gsoc2013-evolution-d4bf3e01bc44d7d8471251e2e890ce0e0ca07113.tar.xz gsoc2013-evolution-d4bf3e01bc44d7d8471251e2e890ce0e0ca07113.tar.zst gsoc2013-evolution-d4bf3e01bc44d7d8471251e2e890ce0e0ca07113.zip |
Code implicitly assumed that event->button.button is 1, 2, or 3, causing
2001-09-17 Jon Trowbridge <trow@ximian.com>
* gui/widgets/e-minicard.c (e_minicard_event): Code implicitly
assumed that event->button.button is 1, 2, or 3, causing disaster
when using a wheel-mouse. Fixed. (bug #9400)
svn path=/trunk/; revision=12926
Diffstat (limited to 'addressbook/gui/widgets/e-minicard.c')
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index d5d2b84bdf..6f6df9b27c 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -511,24 +511,27 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) } break; case GDK_BUTTON_PRESS: { - int 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); - - e_canvas_item_grab_focus(item, TRUE); - - if (gnome_canvas_item_grab (GNOME_CANVAS_ITEM (e_minicard), - mask, NULL, event->button.time)) { - return FALSE; + if (1 <= event->button.button && event->button.button <= 3) { + int 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); + + e_canvas_item_grab_focus(item, TRUE); + + if (gnome_canvas_item_grab (GNOME_CANVAS_ITEM (e_minicard), + mask, NULL, event->button.time)) { + 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; + e_minicard->drag_button = event->button.button; + e_minicard->drag_button_down = TRUE; + return ret_val; } - 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; - e_minicard->drag_button = event->button.button; - e_minicard->drag_button_down = TRUE; - return ret_val; + break; } case GDK_BUTTON_RELEASE: if (e_minicard->drag_button == event->button.button) { |