Hide from Dock on macOS when the tray icon is enabled and the window is closed
This commit is contained in:
parent
bc6d549f20
commit
ffb0b5a27b
3 changed files with 29 additions and 0 deletions
9
main.js
9
main.js
|
@ -63,6 +63,7 @@ const attachments = require('./app/attachments');
|
|||
const attachmentChannel = require('./app/attachment_channel');
|
||||
const updater = require('./ts/updater/index');
|
||||
const createTrayIcon = require('./app/tray_icon');
|
||||
const dockIcon = require('./app/dock_icon');
|
||||
const ephemeralConfig = require('./app/ephemeral_config');
|
||||
const logging = require('./app/logging');
|
||||
const sql = require('./app/sql');
|
||||
|
@ -94,6 +95,9 @@ function showWindow() {
|
|||
if (tray) {
|
||||
tray.updateContextMenu();
|
||||
}
|
||||
|
||||
// show the app on the Dock in case it was hidden before
|
||||
dockIcon.show();
|
||||
}
|
||||
|
||||
if (!process.mas) {
|
||||
|
@ -366,6 +370,11 @@ function createWindow() {
|
|||
tray.updateContextMenu();
|
||||
}
|
||||
|
||||
// hide the app from the Dock on macOS if the tray icon is enabled
|
||||
if (usingTrayIcon) {
|
||||
dockIcon.hide();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue