From 4bd67e4933d86e81bc3475696c304de8694a000e Mon Sep 17 00:00:00 2001 From: deepend Date: Fri, 30 Jan 2026 19:26:34 -0700 Subject: [PATCH] Updated tray tooltip handling to use GTK3 tooltip-text property while keeping GTK2-only tooltip API calls behind #if !HAVE_GTK3. Switched GTK3 embedded checks to use the embedded property instead of GTK2-only API calls, preserving the restore timer behavior. --- src/fe-gtk/plugin-tray.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/fe-gtk/plugin-tray.c b/src/fe-gtk/plugin-tray.c index 73010a16..e229ddf1 100644 --- a/src/fe-gtk/plugin-tray.c +++ b/src/fe-gtk/plugin-tray.c @@ -192,7 +192,12 @@ void fe_tray_set_tooltip (const char *text) { if (sticon) +#if HAVE_GTK3 + g_object_set (G_OBJECT (sticon), "tooltip-text", text, NULL); +#endif +#if !HAVE_GTK3 gtk_status_icon_set_tooltip_text (sticon, text); +#endif } static void @@ -430,9 +435,19 @@ tray_menu_restore_cb (GtkWidget *item, gpointer userdata) static void tray_menu_notify_cb (GObject *tray, GParamSpec *pspec, gpointer user_data) { +#if HAVE_GTK3 + gboolean embedded = FALSE; +#endif + if (sticon) { +#if HAVE_GTK3 + g_object_get (G_OBJECT (sticon), "embedded", &embedded, NULL); + if (!embedded) +#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); }