summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-11-28 20:00:07 -0500
committerMatthias Clasen <mclasen@redhat.com>2009-11-30 22:38:44 -0500
commitdef9343ce0f9c36826567addcdf79cd6b504ad18 (patch)
tree959d8398b09405a845f87bf93c0763e74b4b99c5
parent92289a5b4348fa7d9cc993313a351199a9897117 (diff)
downloadgdk-pixbuf-def9343ce0f9c36826567addcdf79cd6b504ad18.tar.gz
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 25a8c7316d4acb2fe3ada0bef3c087875bc95e45)
-rw-r--r--gtk/gtkuimanager.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtkuimanager.c b/gtk/gtkuimanager.c
index 7bd33496b..7eafec16d 100644
--- a/gtk/gtkuimanager.c
+++ b/gtk/gtkuimanager.c
@@ -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);
}
}