summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2020-12-18 13:49:43 +0100
committerOskar Nyberg <oskar@mullvad.net>2020-12-21 15:44:34 +0100
commit49c99b6c9850d5f7b8558bde179b552d38bdb8e5 (patch)
tree3c149e825c041cbfaa7959096bdf3a3fa860ab84
parent6cc06d0ae697569c56f18b740f3e8a3a1d5e8415 (diff)
downloadmullvadvpn-49c99b6c9850d5f7b8558bde179b552d38bdb8e5.tar.xz
mullvadvpn-49c99b6c9850d5f7b8558bde179b552d38bdb8e5.zip
Set BrowserWindow icon on Linux
-rw-r--r--gui/src/main/index.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts
index 2db95816a0..535d893bb8 100644
--- a/gui/src/main/index.ts
+++ b/gui/src/main/index.ts
@@ -62,6 +62,7 @@ import { ConnectionObserver, DaemonRpc, SubscriptionListener } from './daemon-rp
import { InvalidAccountError } from './errors';
import Expectation from './expectation';
import GuiSettings from './gui-settings';
+import { getAppIcon } from './linux-desktop-entry';
import NotificationController from './notification-controller';
import { resolveBin } from './proc';
import ReconnectionBackoff from './reconnection-backoff';
@@ -365,7 +366,7 @@ class ApplicationMain {
);
this.connectToDaemon();
- const window = this.createWindow();
+ const window = await this.createWindow();
const tray = this.createTray();
const windowController = new WindowController(window, tray, this.guiSettings.unpinnedWindow);
@@ -1340,7 +1341,7 @@ class ApplicationMain {
if (this.tray && this.windowController) {
this.tray.removeAllListeners();
- const window = this.createWindow();
+ const window = await this.createWindow();
this.windowController.replaceWindow(window, unpinnedWindow);
await this.initializeWindow();
@@ -1409,7 +1410,7 @@ class ApplicationMain {
}
}
- private createWindow(): BrowserWindow {
+ private async createWindow(): Promise<BrowserWindow> {
const contentHeight = 568;
// the size of transparent area around arrow on macOS
const headerBarArrowHeight = 12;
@@ -1475,6 +1476,12 @@ class ApplicationMain {
autoHideMenuBar: true,
});
+ case 'linux':
+ return new BrowserWindow({
+ ...options,
+ icon: await getAppIcon('mullvad-vpn'),
+ });
+
default: {
return new BrowserWindow(options);
}