aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-03-01 16:25:25 -0600
committerTed Gould <ted@gould.cx>2012-03-01 16:25:25 -0600
commite0a68da43067e5955f38e62cb5fb1975119082fc (patch)
tree07250062cb44e756884704171e9b39def12a044e /libdbusmenu-gtk
parentb4cb5b91621a0b05f0cfeb311d559d334c56b4b2 (diff)
downloadlibdbusmenu-e0a68da43067e5955f38e62cb5fb1975119082fc.tar.gz
libdbusmenu-e0a68da43067e5955f38e62cb5fb1975119082fc.tar.bz2
libdbusmenu-e0a68da43067e5955f38e62cb5fb1975119082fc.zip
Fixing for GTK2
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r--libdbusmenu-gtk/genericmenuitem.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c
index 4c57319..e9c8367 100644
--- a/libdbusmenu-gtk/genericmenuitem.c
+++ b/libdbusmenu-gtk/genericmenuitem.c
@@ -83,9 +83,11 @@ genericmenuitem_class_init (GenericmenuitemClass *klass)
object_class->dispose = genericmenuitem_dispose;
object_class->finalize = genericmenuitem_finalize;
+#ifdef HAVE_GTK3
GtkWidgetClass * widget_class = GTK_WIDGET_CLASS(klass);
gtk_widget_class_set_accessible_role(widget_class, ATK_ROLE_MENU_ITEM);
+#endif
GtkCheckMenuItemClass * check_class = GTK_CHECK_MENU_ITEM_CLASS (klass);
@@ -113,6 +115,13 @@ genericmenuitem_init (Genericmenuitem *self)
self->priv->disposition = GENERICMENUITEM_DISPOSITION_NORMAL;
self->priv->label_text = NULL;
+#ifndef HAVE_GTK3
+ AtkObject * aobj = gtk_widget_get_accessible(GTK_WIDGET(self));
+ if (aobj != NULL) {
+ atk_object_set_role(aobj, ATK_ROLE_MENU_ITEM);
+ }
+#endif
+
return;
}