Skip to content

Commit b88de32

Browse files
committed
feat: remove the hidden desktop app idea for now
1 parent 2341dbe commit b88de32

File tree

6 files changed

+470
-474
lines changed

6 files changed

+470
-474
lines changed

.yarn/install-state.gz

-23.1 KB
Binary file not shown.

electron-builder.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ module.exports = {
3838
},
3939
hardenedRuntime: true,
4040
gatekeeperAssess: false,
41-
extendInfo: {
42-
LSUIElement: 1,
43-
},
4441
entitlements: 'build-resources/entitlements.mac.plist',
4542
entitlementsInherit: 'build-resources/entitlements.mac.plist',
4643
notarize: false, // do this manually

src/main/lib/DesktopWindow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class DesktopWindow extends TypedEventEmitter<{
3030

3131
constructor(private apiManager: ApiManager) {
3232
super();
33-
void this.open(false);
33+
void this.open(true);
3434
}
3535

3636
public focus(): void {

src/main/lib/Menubar.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ export class Menubar extends EventEmitter {
3939
}
4040

4141
// hide the dock icon if it shows
42-
if (process.platform === 'darwin') {
43-
app.setActivationPolicy('accessory');
44-
}
4542
app.on('second-instance', this.onSecondInstance.bind(this));
4643
app.on('open-file', this.onFileOpened.bind(this));
44+
app.on('window-all-closed', () => {
45+
console.log('window-all-closed');
46+
if (process.platform !== 'darwin') { // On macOS, apps generally stay open until explicitly quit
47+
app.quit();
48+
}
49+
});
4750
app.setAppLogsPath();
4851
(process.env as any).ELECTRON_DISABLE_SECURITY_WARNINGS = true;
4952
void this.appReady();
@@ -55,6 +58,11 @@ export class Menubar extends EventEmitter {
5558
return this.#tray;
5659
}
5760

61+
public async appExit(): Promise<void> {
62+
await this.beforeQuit();
63+
app.exit();
64+
}
65+
5866
private bindSignals(): void {
5967
let didRun = false;
6068
const exit = (): Promise<void> => {
@@ -141,11 +149,6 @@ export class Menubar extends EventEmitter {
141149
}
142150
}
143151

144-
private async appExit(): Promise<void> {
145-
await this.beforeQuit();
146-
app.exit();
147-
}
148-
149152
private async appReady(): Promise<void> {
150153
try {
151154
await app.whenReady();

src/main/lib/WindowManager.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class WindowManager {
3333

3434
this.bindIpcEvents();
3535
this.desktopWindow = new DesktopWindow(apiManager);
36-
this.events.on(this.desktopWindow, 'close', this.checkOpenWindows.bind(this));
36+
this.events.on(this.desktopWindow, 'close', this.close.bind(this));
3737
this.events.on(this.desktopWindow, 'focus', this.setMenu.bind(this));
3838
this.events.on(
3939
apiManager.privateDesktopApiHandler,
@@ -43,13 +43,14 @@ export class WindowManager {
4343
}
4444

4545
public async openDesktop(): Promise<void> {
46-
await app.dock?.show();
4746
this.setMenu();
48-
await this.desktopWindow.open();
47+
await this.desktopWindow.open(true);
4948
}
5049

5150
public close(): void {
51+
console.log('Closing Desktop');
5252
this.events.close();
53+
void this.menuBar.appExit();
5354
}
5455

5556
public async loadChromeAliveWindow(data: {
@@ -61,7 +62,6 @@ export class WindowManager {
6162
this.#chromeAliveWindowsBySessionId.get(data.heroSessionId)?.window.focus();
6263
return;
6364
}
64-
await app.dock?.show();
6565
const chromeAliveWindow = new ChromeAliveWindow(data, data.cloudAddress);
6666

6767
const { heroSessionId } = data;
@@ -167,7 +167,7 @@ export class WindowManager {
167167

168168
private checkOpenWindows(): void {
169169
if (this.chromeAliveWindows.length === 0 && !this.desktopWindow.isOpen) {
170-
app.dock?.hide();
170+
app.quit();
171171
}
172172
}
173173

0 commit comments

Comments
 (0)