diff options
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 6 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 37 |
2 files changed, 26 insertions, 17 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 326fbf2368..21b4e1d2ec 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,9 @@ +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) + 2001-09-16 Chris Toshok <toshok@ximian.com> * gui/contact-editor/e-contact-editor.c (_phone_arrow_pressed): 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) { |