aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk/client.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2016-02-23 23:20:40 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2016-02-23 23:20:40 +0000
commit9f6d06885dd34c63faefeaeb79a057da7ccd7a81 (patch)
tree4a32e0c9de93d246ec4bf1b5a31b3c6522c3f938 /libdbusmenu-gtk/client.c
parenta7274300ba0febe398bef6ac595d2a0722480fd6 (diff)
parent8c4c5b771919d336b88ac9adca647b212436cc8e (diff)
downloadlibdbusmenu-9f6d06885dd34c63faefeaeb79a057da7ccd7a81.tar.gz
libdbusmenu-9f6d06885dd34c63faefeaeb79a057da7ccd7a81.tar.bz2
libdbusmenu-9f6d06885dd34c63faefeaeb79a057da7ccd7a81.zip
gtk: look for GtkImages on regular GtkMenuItems too
GtkImageMenuItem is deprecated, and the recommended replacement is a normal GtkMenuItem packed manually with a label and an image. To ensure applications that use recommended GTK practices can still show menu item images, check the children of a normal GtkMenuItem for a GtkImage too, just like is done for the label child. Fixes: #1549021 Approved by: Marco Trevisan (TreviƱo)
Diffstat (limited to 'libdbusmenu-gtk/client.c')
-rw-r--r--libdbusmenu-gtk/client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c
index d345313..7e1ea36 100644
--- a/libdbusmenu-gtk/client.c
+++ b/libdbusmenu-gtk/client.c
@@ -842,7 +842,7 @@ activate_helper (GtkMenuShell * shell)
doesn't expose the right variables. We need to figure
this out as menus won't get grabs properly.
TODO FIXME HELP ARGHHHHHHHH */
-#if (HAVE_GTK3 == 0)
+#if !GTK_CHECK_VERSION(3,0,0)
if (!GTK_MENU_SHELL (parent)->active) {
gtk_grab_add (parent);
GTK_MENU_SHELL (parent)->have_grab = TRUE;
@@ -1278,7 +1278,12 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, GVariant
gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
gtk_widget_set_size_request(GTK_WIDGET(gtkimage), width, height);
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_halign(GTK_WIDGET(gtkimage), GTK_ALIGN_START);
+ gtk_widget_set_valign(GTK_WIDGET(gtkimage), GTK_ALIGN_CENTER);
+#else
gtk_misc_set_alignment(GTK_MISC(gtkimage), 0.0, 0.5);
+#endif
}
genericmenuitem_set_image(GENERICMENUITEM(gimi), gtkimage);