Bug 541315 – Segfault when selecting a GtkMenuItem with submenu and no

2008-08-18  Björn Lindqvist  <bjourne@gmail.com>

	Bug 541315 – Segfault when selecting a GtkMenuItem with submenu
	and no parent

	* gtk/gtkmenuitem.c (gtk_menu_item_real_popup_submenu): Ensure
	that the menu item has a parent before popping it up.

svn path=/trunk/; revision=21149
This commit is contained in:
Björn Lindqvist 2008-08-18 17:48:13 +00:00 committed by Björn Lindqvist
parent 3f5d891403
commit 7df6b76a1a
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2008-08-18 Björn Lindqvist <bjourne@gmail.com>
Bug 541315 Segfault when selecting a GtkMenuItem with submenu
and no parent
* gtk/gtkmenuitem.c (gtk_menu_item_real_popup_submenu): Ensure
that the menu item has a parent before popping it up.
2008-08-18 Johan Dahlin <johan@gnome.org>
Bug 548196 gtk-builder-convert doesn't properly convert GtkTextView

View File

@ -1137,7 +1137,7 @@ gtk_menu_item_real_popup_submenu (GtkWidget *widget,
{
GtkMenuItem *menu_item = GTK_MENU_ITEM (widget);
if (GTK_WIDGET_IS_SENSITIVE (menu_item->submenu))
if (GTK_WIDGET_IS_SENSITIVE (menu_item->submenu) && widget->parent)
{
gboolean take_focus;
GtkMenuPositionFunc menu_position_func;