[gtk+] Bug 601869 - GtkUIManager assumes too much about popup menus
- From: Matthew Barnes <mbarnes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Bug 601869 - GtkUIManager assumes too much about popup menus
- Date: Sun, 29 Nov 2009 01:02:22 +0000 (UTC)
commit 25a8c7316d4acb2fe3ada0bef3c087875bc95e45
Author: Matthew Barnes <mbarnes redhat com>
Date: Sat Nov 28 20:00:07 2009 -0500
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.
gtk/gtkuimanager.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkuimanager.c b/gtk/gtkuimanager.c
index 771252d..dff9085 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 "gtkimagemenuitem.h"
@@ -2615,8 +2616,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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]