Skip to content

Commit

Permalink
Do not use app.relaunch() in AppImage
Browse files Browse the repository at this point in the history
  • Loading branch information
oza6ut0ne committed Dec 19, 2020
1 parent 9a3a680 commit 46422c9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { aliveOrNull } from '../common/util';
import { config, toggleStatusWithAuto } from './config';
import { togglePause } from './ipc';

const isAppImage = process.platform === 'linux' && app.isPackaged && app.getPath('exe').startsWith('/tmp/.mount_');

export let tray: Tray | null = null;
let trayMenu: Menu | null = null;

Expand Down Expand Up @@ -48,8 +50,10 @@ function createTrayMenu(windows: BrowserWindow[]): Menu {
return { label: v, checked: config.useMultiWindow === v,
type: 'radio', click: () => {
config.useMultiWindow = v;
app.relaunch();
app.quit();
if (!isAppImage) {
app.relaunch();
app.quit();
}
}}
})}
]}
Expand All @@ -59,7 +63,7 @@ function createTrayMenu(windows: BrowserWindow[]): Menu {
addDebugMenu(contextMenu, windows);
}

contextMenu.append(new MenuItem({ label: 'Restart', click: () => {
contextMenu.append(new MenuItem({ label: 'Restart', visible: !isAppImage, click: () => {
app.relaunch();
app.quit();
}}));
Expand Down

0 comments on commit 46422c9

Please sign in to comment.