Fix Win tray restore timer loop/reentry

This commit is contained in:
2026-05-19 21:39:02 -06:00
parent 7e34690e0c
commit f84a448351

View File

@@ -920,7 +920,10 @@ tray_menu_notify_cb (GObject *tray, GParamSpec *pspec, gpointer user_data)
{ {
if (!tray_backend_is_embedded ()) if (!tray_backend_is_embedded ())
{ {
tray_restore_timer = g_timeout_add(500, (GSourceFunc)tray_menu_try_restore, NULL); if (!tray_restore_timer)
{
tray_restore_timer = g_timeout_add (500, (GSourceFunc) tray_menu_try_restore, NULL);
}
} }
else else
{ {
@@ -936,9 +939,10 @@ tray_menu_notify_cb (GObject *tray, GParamSpec *pspec, gpointer user_data)
static gboolean static gboolean
tray_menu_try_restore (void) tray_menu_try_restore (void)
{ {
tray_cleanup(); tray_restore_timer = 0;
tray_init(); tray_cleanup ();
return TRUE; tray_init ();
return G_SOURCE_REMOVE;
} }
static void static void