aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-09-18 09:40:20 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-09-18 09:40:20 +0800
commitd4bf3e01bc44d7d8471251e2e890ce0e0ca07113 (patch)
tree308132504f4a34bb701dc842ead7093e35751166
parent999889586bbb251669c5a384f1b5d03bd72d0a6d (diff)
downloadgsoc2013-evolution-d4bf3e01bc44d7d8471251e2e890ce0e0ca07113.tar.gz
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
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/gui/widgets/e-minicard.c37
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) {