diff --git a/src/fe-gtk/plugin-tray.c b/src/fe-gtk/plugin-tray.c index 33702284..88fc11f3 100644 --- a/src/fe-gtk/plugin-tray.c +++ b/src/fe-gtk/plugin-tray.c @@ -188,16 +188,21 @@ tray_set_custom_icon_state (TrayCustomIcon icon, TrayIconState state) tray_icon_state = state; } -#if HAVE_GTK3 static void tray_set_tooltip_text (GtkStatusIcon *icon, const char *text) { +#if HAVE_GTK3 g_object_set (G_OBJECT (icon), "tooltip-text", text, NULL); +#endif +#if !HAVE_GTK3 + gtk_status_icon_set_tooltip_text (icon, text); +#endif } static gboolean tray_is_embedded (GtkStatusIcon *icon) { +#if HAVE_GTK3 GObjectClass *klass; gboolean embedded = TRUE; @@ -209,19 +214,17 @@ tray_is_embedded (GtkStatusIcon *icon) g_object_get (G_OBJECT (icon), "embedded", &embedded, NULL); return embedded; -} #endif +#if !HAVE_GTK3 + return gtk_status_icon_is_embedded (icon); +#endif +} void fe_tray_set_tooltip (const char *text) { if (sticon) -#if HAVE_GTK3 tray_set_tooltip_text (sticon, text); -#endif -#if !HAVE_GTK3 - gtk_status_icon_set_tooltip_text (sticon, text); -#endif } static void @@ -461,12 +464,7 @@ tray_menu_notify_cb (GObject *tray, GParamSpec *pspec, gpointer user_data) { if (sticon) { -#if HAVE_GTK3 if (!tray_is_embedded (sticon)) -#endif -#if !HAVE_GTK3 - if (!gtk_status_icon_is_embedded (sticon)) -#endif { tray_restore_timer = g_timeout_add(500, (GSourceFunc)tray_menu_try_restore, NULL); }