[gtk+] menubutton: don't dereference NULL GdkEvent



commit d22624b18e1123659dcbb6e069eab15ea3072828
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Jun 29 18:30:53 2012 -0400

    menubutton: don't dereference NULL GdkEvent
    
    Since we explictly call popup_menu with NULL when it's
    keyboard-activated, we need to be careful and not access event->device
    without checking for event != NULL before.

 gtk/gtkmenubutton.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c
index 4c1a2f1..63bea8c 100644
--- a/gtk/gtkmenubutton.c
+++ b/gtk/gtkmenubutton.c
@@ -307,7 +307,9 @@ popup_menu (GtkMenuButton  *menu_button,
         break;
   }
 
-  gtk_menu_popup_for_device (GTK_MENU (priv->menu), event->device, NULL, NULL,
+  gtk_menu_popup_for_device (GTK_MENU (priv->menu),
+                             event ? event->device : NULL,
+                             NULL, NULL,
                              func,
                              GTK_WIDGET (menu_button),
                              NULL,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]