diff options
Diffstat (limited to 'packages/meshbay-client/src')
| -rw-r--r-- | packages/meshbay-client/src/main.js | 10 | ||||
| -rw-r--r-- | packages/meshbay-client/src/preload.js | 8 | ||||
| -rw-r--r-- | packages/meshbay-client/src/tray-icon.png | bin | 504 -> 829 bytes | |||
| -rw-r--r-- | packages/meshbay-client/src/tray-icon@2x.png | bin | 967 -> 1807 bytes |
4 files changed, 10 insertions, 8 deletions
diff --git a/packages/meshbay-client/src/main.js b/packages/meshbay-client/src/main.js index 273d151..74c8203 100644 --- a/packages/meshbay-client/src/main.js +++ b/packages/meshbay-client/src/main.js @@ -328,12 +328,13 @@ const HUB_FETCH_TIMEOUT_MS = 30000; let mainWindow = null; // ── System tray ────────────────────────────────────────────────────────────── -// Linux only for now; Windows is being done on that OS. +// Linux and Windows. // // The context menu is not optional. Under libappindicator -- which is how GNOME // shows a tray at all, via the AppIndicator extension -- `tray.on('click')` // never fires: the indicator only opens its menu. A tray whose only affordance -// was a click would be inert on the one desktop this targets. +// was a click would be inert there -- Windows does send it, so the same handler +// restores the window on a plain left click. // // Labels arrive from the renderer rather than being translated here. The locale // files are the interface's, the main process has no i18n, and a second string @@ -413,7 +414,7 @@ function ensureTray(labels) { tray = new Tray(path.join(__dirname, 'tray-icon.png')); tray.setToolTip('MeshBay'); refreshTrayMenu(); - // Harmless where it does nothing (GNOME), useful on desktops that do send it. + // No-op on GNOME (never fires there), the left-click restore on Windows. tray.on('click', showFromTray); if (!trayTimer) trayTimer = setInterval(refreshTrayMenu, TRAY_POLL_MS); return tray; @@ -638,7 +639,8 @@ function registerBridge() { // make "minimise to tray" mean "exit". A hidden window keeps the session, the // transfers and the node connection exactly as they were. ipcMain.handle('window:minimize-to-tray', (_e, labels) => { - if (process.platform !== 'linux' || !mainWindow) return false; + const trayOS = process.platform === 'linux' || process.platform === 'win32'; + if (!trayOS || !mainWindow) return false; ensureTray(labels); mainWindow.hide(); return true; diff --git a/packages/meshbay-client/src/preload.js b/packages/meshbay-client/src/preload.js index 1aa16e5..b390bfb 100644 --- a/packages/meshbay-client/src/preload.js +++ b/packages/meshbay-client/src/preload.js @@ -41,10 +41,10 @@ contextBridge.exposeInMainWorld('meshbay', { localFolders: true, nativeSave: true, lanCast: true, - // Linux only for now -- Windows is being done on that OS. Declared per - // platform rather than always: a button that hides the window somewhere the - // desktop shows no indicator would hide it for good. - tray: process.platform === 'linux', + // Linux and Windows have a tray to hide into; declared per platform + // rather than always, so the button never appears somewhere the desktop + // shows no indicator, which would hide the window for good. + tray: process.platform === 'linux' || process.platform === 'win32', }, // Labels are passed in because the main process has no i18n; see main.js. diff --git a/packages/meshbay-client/src/tray-icon.png b/packages/meshbay-client/src/tray-icon.png Binary files differindex 98fd63b..9b54a5d 100644 --- a/packages/meshbay-client/src/tray-icon.png +++ b/packages/meshbay-client/src/tray-icon.png diff --git a/packages/meshbay-client/src/tray-icon@2x.png b/packages/meshbay-client/src/tray-icon@2x.png Binary files differindex 9cf613d..932a69d 100644 --- a/packages/meshbay-client/src/tray-icon@2x.png +++ b/packages/meshbay-client/src/tray-icon@2x.png |