summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2022-09-30 16:14:13 +0200
committerOskar Nyberg <oskar@mullvad.net>2022-09-30 16:14:13 +0200
commitde0ce22d13a6dc8bd5bc7b734b88c3a60a77aa24 (patch)
tree3be6d9fc7f3e80f93be84fb8712600f1dbae4f38 /gui
parentfff4651f823c79a09b9f2883013561f777389180 (diff)
parent46a939d6fdf25887e9eeac1ee3345725030caa9e (diff)
downloadmullvadvpn-de0ce22d13a6dc8bd5bc7b734b88c3a60a77aa24.tar.xz
mullvadvpn-de0ce22d13a6dc8bd5bc7b734b88c3a60a77aa24.zip
Merge branch 'fix-icon-not-found'
Diffstat (limited to 'gui')
-rw-r--r--gui/src/main/index.ts11
-rw-r--r--gui/src/main/linux-desktop-entry.ts8
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.