Bug 601869 - GtkUIManager assumes too much about popup menus

Check that the child of a popup menu item is actually a GtkAccelLabel
before setting its "accel-closure" property.
(cherry picked from commit 25a8c7316d)
This commit is contained in:
Matthew Barnes
2009-11-28 20:00:07 -05:00
committed by Matthias Clasen
parent 92289a5b43
commit def9343ce0

View File

@@ -31,6 +31,7 @@
#include "config.h"
#include <string.h>
#include "gtkaccellabel.h"
#include "gtkactivatable.h"
#include "gtkbuildable.h"
#include "gtkintl.h"
@@ -2625,8 +2626,9 @@ update_node (GtkUIManager *self,
if (in_popup && !popup_accels)
{
/* don't show accels in popups */
GtkWidget *label = GTK_BIN (info->proxy)->child;
g_object_set (label, "accel-closure", NULL, NULL);
GtkWidget *child = gtk_bin_get_child (GTK_BIN (info->proxy));
if (GTK_IS_ACCEL_LABEL (child))
g_object_set (child, "accel-closure", NULL, NULL);
}
}