aboutsummaryrefslogtreecommitdiffstats
path: root/src/index.js
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2020-05-17 15:17:07 +0200
committerLibravatar GitHub <noreply@github.com>2020-05-17 13:17:07 +0000
commit4576a5080c51918907c89629cefe389945179d71 (patch)
tree614e278ac7a4b9f55ce393eba4d40b37bd3724f1 /src/index.js
parentReplace change server input with a dropdown menu (#717) (diff)
downloadferdium-app-4576a5080c51918907c89629cefe389945179d71.tar.gz
ferdium-app-4576a5080c51918907c89629cefe389945179d71.tar.zst
ferdium-app-4576a5080c51918907c89629cefe389945179d71.zip
Make Tray icons more robust on Linux (#748)
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/index.js b/src/index.js
index 484191f2e..9dfbb4d8f 100644
--- a/src/index.js
+++ b/src/index.js
@@ -35,6 +35,7 @@ import {
35import { mainIpcHandler as basicAuthHandler } from './features/basicAuth'; 35import { mainIpcHandler as basicAuthHandler } from './features/basicAuth';
36import ipcApi from './electron/ipc-api'; 36import ipcApi from './electron/ipc-api';
37import Tray from './lib/Tray'; 37import Tray from './lib/Tray';
38import DBus from './lib/DBus';
38import Settings from './electron/Settings'; 39import Settings from './electron/Settings';
39import handleDeepLink from './electron/deepLinking'; 40import handleDeepLink from './electron/deepLinking';
40import { isPositionValid } from './electron/windowUtils'; 41import { isPositionValid } from './electron/windowUtils';
@@ -213,6 +214,9 @@ const createWindow = () => {
213 // Initialize System Tray 214 // Initialize System Tray
214 const trayIcon = new Tray(); 215 const trayIcon = new Tray();
215 216
217 // Initialize DBus interface
218 const dbus = new DBus(trayIcon);
219
216 // Initialize ipcApi 220 // Initialize ipcApi
217 ipcApi({ 221 ipcApi({
218 mainWindow, 222 mainWindow,
@@ -223,6 +227,9 @@ const createWindow = () => {
223 trayIcon, 227 trayIcon,
224 }); 228 });
225 229
230 // Connect to the DBus after ipcApi took care of the System Tray
231 dbus.start();
232
226 // Manage Window State 233 // Manage Window State
227 mainWindowState.manage(mainWindow); 234 mainWindowState.manage(mainWindow);
228 235
@@ -265,6 +272,7 @@ const createWindow = () => {
265 mainWindow.hide(); 272 mainWindow.hide();
266 } 273 }
267 } else { 274 } else {
275 dbus.stop();
268 app.quit(); 276 app.quit();
269 } 277 }
270 }); 278 });