summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEmīls Piņķis <emils@mullvad.net>2018-04-19 16:47:18 +0100
committerEmīls Piņķis <emils@mullvad.net>2018-04-24 13:15:50 +0100
commit9bb72e27a3407b7177f2c2aa6961c66c8d1ec687 (patch)
tree89f6daa439355ea416a2a284188dc1acf576b8dd
parentc03640de300efcf5b7ada700a64850dca3a7541e (diff)
downloadmullvadvpn-9bb72e27a3407b7177f2c2aa6961c66c8d1ec687.tar.xz
mullvadvpn-9bb72e27a3407b7177f2c2aa6961c66c8d1ec687.zip
Adjust window management on linux
-rw-r--r--app/main.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/app/main.js b/app/main.js
index df7f9fbf50..dc3b5f4c86 100644
--- a/app/main.js
+++ b/app/main.js
@@ -161,6 +161,11 @@ const appDelegate = {
await appDelegate._installDevTools();
window.openDevTools({ mode: 'detach' });
}
+
+ // Tray icon might not be supported on all linux distributions
+ if (process.platform === 'linux') {
+ window.show();
+ }
},
onAllWindowsClosed: () => {
@@ -294,6 +299,7 @@ const appDelegate = {
},
_createWindow: (): BrowserWindow => {
+ log.debug('Main process PID - ', process.pid);
const contentHeight = 568;
const options = {
width: 320,
@@ -302,6 +308,7 @@ const appDelegate = {
maximizable: false,
fullscreenable: false,
show: false,
+ frame: false,
webPreferences: {
// prevents renderer process code from not running when window is hidden
backgroundThrottling: false,
@@ -317,7 +324,6 @@ const appDelegate = {
...options,
// 12 is the size of transparent area around arrow
height: contentHeight + 12,
- frame: false,
transparent: true
});
@@ -331,10 +337,15 @@ const appDelegate = {
// setup window flags to mimic an overlay window
return new BrowserWindow({
...options,
- frame: false,
transparent: true
});
+ case 'linux':
+ return new BrowserWindow({
+ ...options,
+ show: true,
+ });
+
default:
return new BrowserWindow(options);
}
@@ -515,7 +526,9 @@ const appDelegate = {
// setup event handlers
window.on('close', () => window.closeDevTools());
- window.on('blur', () => !window.isDevToolsOpened() && window.hide());
+ if (process.platform !== 'linux') {
+ window.on('blur', () => !window.isDevToolsOpened() && window.hide());
+ }
if(process.platform === 'darwin') {
// disable icon highlight on macOS