aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@ximian.com>2001-02-28 12:07:54 +0800
committerMiguel de Icaza <miguel@src.gnome.org>2001-02-28 12:07:54 +0800
commit51e975bf37182f42f04e36baa2436b51babe5913 (patch)
tree033bf72930492927ae65f22ae2bbc29ce2f5ad4e /widgets
parent6a8d4951dc284e0f3d3e1645d258d3a9968025c8 (diff)
downloadgsoc2013-evolution-51e975bf37182f42f04e36baa2436b51babe5913.tar.gz
gsoc2013-evolution-51e975bf37182f42f04e36baa2436b51babe5913.tar.zst
gsoc2013-evolution-51e975bf37182f42f04e36baa2436b51babe5913.zip
Make this more robust: do not assume that the GdkEvent will be either a
2001-02-27 Miguel de Icaza <miguel@ximian.com> * gal/widgets/e-gui-utils.c (e_popup_menu): Make this more robust: do not assume that the GdkEvent will be either a GdkEventButton of some sort or a GdkEventKey: deal gracefully with other possible svn path=/trunk/; revision=8423
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-gui-utils.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/widgets/misc/e-gui-utils.c b/widgets/misc/e-gui-utils.c
index 0d3dcf0728..9019ae18c5 100644
--- a/widgets/misc/e-gui-utils.c
+++ b/widgets/misc/e-gui-utils.c
@@ -62,10 +62,16 @@ e_popup_menu (GtkMenu *menu, GdkEvent *event)
g_return_if_fail (GTK_IS_MENU (menu));
e_auto_kill_popup_menu_on_hide (menu);
+
if (event->type == GDK_KEY_PRESS)
gtk_menu_popup (menu, NULL, NULL, 0, NULL, 0, event->key.time);
- else
+ else if ((event->type == GDK_BUTTON_PRESS) ||
+ (event->type == GDK_BUTTON_RELEASE) ||
+ (event->type == GDK_2BUTTON_PRESS) ||
+ (event->type == GDK_3BUTTON_PRESS)){
gtk_menu_popup (menu, NULL, NULL, 0, NULL, event->button.button, event->button.time);
+ } else
+ gtk_menu_popup (menu, NULL, NULL, 0, NULL, 0, GDK_CURRENT_TIME);
}
typedef struct {