diff options
-rw-r--r-- | widgets/misc/e-gui-utils.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/widgets/misc/e-gui-utils.c b/widgets/misc/e-gui-utils.c index 59c499e4c1..886fb3d7ca 100644 --- a/widgets/misc/e-gui-utils.c +++ b/widgets/misc/e-gui-utils.c @@ -48,15 +48,21 @@ e_popup_menu (GtkMenu *menu, GdkEvent *event) e_auto_kill_popup_menu_on_selection_done (menu); - if (event->type == GDK_KEY_PRESS) - gtk_menu_popup (menu, NULL, NULL, 0, NULL, 0, event->key.time); - 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); + if (event) { + if (event->type == GDK_KEY_PRESS) + gtk_menu_popup (menu, NULL, NULL, 0, NULL, 0, + event->key.time); + 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); + gtk_menu_popup (menu, NULL, NULL, 0, NULL, 0, + GDK_CURRENT_TIME); } typedef struct { |