diff --git a/fluxer_desktop/electron-builder.config.cjs b/fluxer_desktop/electron-builder.config.cjs index 930228256..252ad0ae0 100644 --- a/fluxer_desktop/electron-builder.config.cjs +++ b/fluxer_desktop/electron-builder.config.cjs @@ -23,7 +23,7 @@ const rpmBuildIdLinkFpmArgs = [ '--rpm-rpmbuild-define', '_missing_build_ids_terminate_build 0', ]; -const macOSMinimumSystemVersion = '12.0'; +const macOSMinimumSystemVersion = '13.0'; const isLinuxBuild = process.argv.includes('--linux'); const isMacBuild = process.argv.includes('--mac'); const isWindowsBuild = process.argv.includes('--win'); diff --git a/fluxer_desktop/package.json b/fluxer_desktop/package.json index d3f6b2972..7fc00543c 100644 --- a/fluxer_desktop/package.json +++ b/fluxer_desktop/package.json @@ -25,7 +25,7 @@ "devDependencies": { "@types/node": "24.10.9", "@typescript/native-preview": "7.0.0-dev.20260130.1", - "electron": "42.10.0", + "electron": "44.1.1", "electron-builder": "27.0.0-alpha.7", "electron-builder-squirrel-windows": "27.0.0-alpha.7", "esbuild": "0.27.2", diff --git a/fluxer_desktop/src/main/Autostart.ts b/fluxer_desktop/src/main/Autostart.ts index 5a7706f74..98cfa2075 100644 --- a/fluxer_desktop/src/main/Autostart.ts +++ b/fluxer_desktop/src/main/Autostart.ts @@ -79,7 +79,6 @@ const AUTOSTART_LAUNCH_ARG = '--autostart'; interface AutoLaunchConfig { name: string; path: string; - isHidden: boolean; args: Array; } @@ -152,7 +151,6 @@ function getAutoLaunchConfig(): AutoLaunchConfig { return { name: isWindows ? WINDOWS_APP_USER_MODEL_ID : APP_NAME, path: isWindows ? getWindowsLoginItemPath() : isLinux ? getStableLinuxLaunchPath() : process.execPath, - isHidden: false, args: [AUTOSTART_LAUNCH_ARG], }; } @@ -174,13 +172,11 @@ function getWindowsAutoLaunchConfigs(): Array { configs.push({ name, path: launchPath, - isHidden: false, args: [AUTOSTART_LAUNCH_ARG], }); configs.push({ name, path: launchPath, - isHidden: false, args: [], }); } @@ -289,7 +285,7 @@ export function isAutostartLaunch(): boolean { } if (isMac) { const settings = app.getLoginItemSettings(); - return Boolean(settings.wasOpenedAtLogin || settings.wasOpenedAsHidden); + return Boolean(settings.wasOpenedAtLogin); } return false; } @@ -502,7 +498,6 @@ async function enableAutostart(): Promise { if (isMac) { app.setLoginItemSettings({ openAtLogin: true, - openAsHidden: config.isHidden, }); return; } diff --git a/fluxer_desktop/src/main/DesktopTray.ts b/fluxer_desktop/src/main/DesktopTray.ts index edb6f72c5..6bc202390 100644 --- a/fluxer_desktop/src/main/DesktopTray.ts +++ b/fluxer_desktop/src/main/DesktopTray.ts @@ -383,7 +383,9 @@ function buildTrayMenu(): Menu { label: t('desktop.tray.copyBuildInfo'), click: () => { runTrayMenuAction(() => { - clipboard.writeText(trayState.buildInfo ?? ''); + void clipboard.writeText(trayState.buildInfo ?? '').catch((error) => { + logger.error('Failed to copy build info to the clipboard', {error}); + }); }); }, }); diff --git a/fluxer_desktop/src/main/IpcHandlers.ts b/fluxer_desktop/src/main/IpcHandlers.ts index dc5fc9ed1..a7f349fa8 100644 --- a/fluxer_desktop/src/main/IpcHandlers.ts +++ b/fluxer_desktop/src/main/IpcHandlers.ts @@ -342,10 +342,10 @@ export function registerIpcHandlers(): void { } await openExternalDeduped(url); }); - ipcMain.handle('clipboard-write-text', (_event, text: string): void => { - clipboard.writeText(text); + ipcMain.handle('clipboard-write-text', async (_event, text: string): Promise => { + await clipboard.writeText(text); }); - ipcMain.handle('clipboard-read-text', (): string => { + ipcMain.handle('clipboard-read-text', (): Promise => { return clipboard.readText(); }); ipcMain.handle('clipboard-write-file', async (event, rawOptions: unknown): Promise => { diff --git a/fluxer_desktop/src/main/MediaClipboard.ts b/fluxer_desktop/src/main/MediaClipboard.ts index 84b234c05..b48cec46c 100644 --- a/fluxer_desktop/src/main/MediaClipboard.ts +++ b/fluxer_desktop/src/main/MediaClipboard.ts @@ -13,7 +13,7 @@ import type { ClipboardWriteFileResult, } from '@electron/common/Types'; import {downloadFile} from '@electron/main/FileDownloads'; -import {app, clipboard} from 'electron'; +import {app, ClipboardItem, clipboard} from 'electron'; const requireModule = createRequire(import.meta.url); @@ -73,6 +73,8 @@ function loadWinClipboardModule(): WinClipboardModule { const logger = createChildLogger('MediaClipboard'); const CACHE_DIR_NAME = 'clipboard-media'; +const WINDOWS_FILE_NAME_W_FORMAT = 'electron application/osclipboard;format="FileNameW"'; +const GNOME_COPIED_FILES_FORMAT = 'electron application/osclipboard;format="x-special/gnome-copied-files"'; const MAX_CACHE_AGE_MS = 24 * 60 * 60 * 1000; const MAX_CACHE_ITEMS = 25; const CACHE_SLOW_TRIM_INTERVAL_MS = 30 * 60 * 1000; @@ -153,7 +155,7 @@ async function writeMacFileReference(filePath: string): Promise { return; } const fileUrl = pathToFileURL(filePath).toString(); - clipboard.writeText(fileUrl); + await clipboard.writeText(fileUrl); } async function writeWindowsFileReference(filePath: string): Promise { @@ -168,19 +170,23 @@ async function writeWindowsFileReference(filePath: string): Promise { logger.warn('Native win-clipboard write failed; falling back to FileNameW buffer', {error}); } } - clipboard.writeBuffer('FileNameW', Buffer.concat([Buffer.from(filePath, 'ucs2'), Buffer.from([0, 0])])); + await clipboard.write([ + new ClipboardItem({ + [WINDOWS_FILE_NAME_W_FORMAT]: new Blob([Buffer.concat([Buffer.from(filePath, 'ucs2'), Buffer.from([0, 0])])]), + }), + ]); } -function writeLinuxFileReference(filePath: string): void { +async function writeLinuxFileReference(filePath: string): Promise { const fileUrl = pathToFileURL(filePath).toString(); const desktop = `${process.env.XDG_CURRENT_DESKTOP ?? ''} ${process.env.DESKTOP_SESSION ?? ''}`.toLowerCase(); const isGnomeLike = desktop.includes('gnome') || desktop.includes('unity') || desktop.includes('cinnamon') || desktop.includes('xfce'); if (isGnomeLike) { - clipboard.writeBuffer('x-special/gnome-copied-files', Buffer.from(`copy\n${fileUrl}\n`, 'utf8')); + await clipboard.write([new ClipboardItem({[GNOME_COPIED_FILES_FORMAT]: `copy\n${fileUrl}\n`})]); return; } - clipboard.writeBuffer('text/uri-list', Buffer.from(`${fileUrl}\n`, 'utf8')); + await clipboard.write([new ClipboardItem({'text/uri-list': `${fileUrl}\n`})]); } async function writeFileReferenceToClipboard(filePath: string): Promise { @@ -192,7 +198,7 @@ async function writeFileReferenceToClipboard(filePath: string): Promise { await writeWindowsFileReference(filePath); return; case 'linux': - writeLinuxFileReference(filePath); + await writeLinuxFileReference(filePath); return; default: throw new Error(`Unsupported clipboard file platform: ${process.platform}`); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c9c22a555..a8f69c43d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1764,8 +1764,8 @@ importers: specifier: 7.0.0-dev.20260130.1 version: 7.0.0-dev.20260130.1 electron: - specifier: 42.10.0 - version: 42.10.0 + specifier: 44.1.1 + version: 44.1.1 electron-builder: specifier: 27.0.0-alpha.7 version: 27.0.0-alpha.7(electron-builder-squirrel-windows@27.0.0-alpha.7) @@ -8073,8 +8073,8 @@ packages: resolution: {integrity: sha512-bO3y10YikuUwUuDUQRM4KfwNkKhnpVO7IPdbsrejwN9/AABJzzTQ4GeHwyzNSrVO+tEH3/Np255a3sVZpZDjvg==} engines: {node: '>=8.0.0'} - electron@42.10.0: - resolution: {integrity: sha512-yBWnZO8tKId0ADvGa4+imPmm3+8Kfs8MtkUPhQQJz1AjTnUUDwCTWkQEU0CrArVVL97Jo4Q/0mVcLHciicBDGQ==} + electron@44.1.1: + resolution: {integrity: sha512-N2WCq2sbOkqQgvXJYx2lS6UiO8bF+Yr67trDnS6JKa2WxTCRQsAjGl57SUtdW9h6r5PlduBFjIhxhgd3dzv1hg==} engines: {node: '>= 22.12.0'} hasBin: true @@ -17381,7 +17381,7 @@ snapshots: transitivePeerDependencies: - supports-color - electron@42.10.0: + electron@44.1.1: dependencies: '@electron-internal/extract-zip': 1.0.5 '@electron/get': 5.1.0