From 40378ec79b5b0db4ead4933aa078c671cd614621 Mon Sep 17 00:00:00 2001 From: lucor Date: Sun, 5 Nov 2023 12:27:14 +0100 Subject: [PATCH 1/2] systray: ensure title is not empty Some desktop environments like the one provided by Ubuntu 22.04 requires the systray title to be not empty to be displayed. This commit ensure the title is always set trying to use the app name from metadata. If the app name is not set will fallback to the app ID Fixes #3678 --- internal/driver/glfw/driver_desktop.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/driver/glfw/driver_desktop.go b/internal/driver/glfw/driver_desktop.go index 6d6fd635cc..7d3ccfb8de 100644 --- a/internal/driver/glfw/driver_desktop.go +++ b/internal/driver/glfw/driver_desktop.go @@ -46,6 +46,12 @@ func (d *gLDriver) SetSystemTrayMenu(m *fyne.Menu) { d.SetSystemTrayIcon(theme.BrokenImageIcon()) } + title := fyne.CurrentApp().Metadata().Name + if title == "" { + title = fyne.CurrentApp().UniqueID() + } + systray.SetTitle(title) + // it must be refreshed after init, so an earlier call would have been ineffective d.refreshSystray(m) }, func() { From 4918889c05e332fca3d7aaa3a186e500557b570c Mon Sep 17 00:00:00 2001 From: Luca Corbo Date: Tue, 7 Nov 2023 14:20:35 +0100 Subject: [PATCH 2/2] Update internal/driver/glfw/driver_desktop.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jacob Alzén --- internal/driver/glfw/driver_desktop.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/driver/glfw/driver_desktop.go b/internal/driver/glfw/driver_desktop.go index 7d3ccfb8de..5660d745ed 100644 --- a/internal/driver/glfw/driver_desktop.go +++ b/internal/driver/glfw/driver_desktop.go @@ -46,9 +46,10 @@ func (d *gLDriver) SetSystemTrayMenu(m *fyne.Menu) { d.SetSystemTrayIcon(theme.BrokenImageIcon()) } - title := fyne.CurrentApp().Metadata().Name + app := fyne.CurrentApp() + title := app.Metadata().Name if title == "" { - title = fyne.CurrentApp().UniqueID() + title = app.UniqueID() } systray.SetTitle(title)