diff options
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/main/index.ts | 11 | ||||
| -rw-r--r-- | gui/src/main/linux-desktop-entry.ts | 8 |
2 files changed, 13 insertions, 6 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index ef6fdc894b..9a396d4307 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -422,9 +422,14 @@ class ApplicationMain } if (process.platform === 'linux') { - const icon = await findIconPath('mullvad-vpn'); - if (icon) { - this.userInterface.setWindowIcon(icon); + try { + const icon = await findIconPath('mullvad-vpn', ['png']); + if (icon) { + this.userInterface.setWindowIcon(icon); + } + } catch (e) { + const error = e as Error; + log.error('Failed to set window icon:', error.message); } } diff --git a/gui/src/main/linux-desktop-entry.ts b/gui/src/main/linux-desktop-entry.ts index 23b2756f23..acac772ce5 100644 --- a/gui/src/main/linux-desktop-entry.ts +++ b/gui/src/main/linux-desktop-entry.ts @@ -219,10 +219,12 @@ export async function getImageDataUrl(imagePath: string): Promise<string> { } // Returns the path of the icon with the specified name. If none is found it returns undefined. -export async function findIconPath(name: string): Promise<string | undefined> { +export async function findIconPath( + name: string, + allowedExtensions = ['svg', 'png'], +): Promise<string | undefined> { // Chromium doesn't support .xpm files - const extensions = ['svg', 'png']; - return findIcon(name, extensions, [ + return findIcon(name, allowedExtensions, [ getIconDirectories(), await getGtkThemeDirectories(), // Begin with preferred sized but if nothing matches other sizes should be considered as well. |
