diff --git a/package.json b/package.json index 6bd828840..8584c2e26 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "test:e2e": "npx playwright test" }, "dependencies": { - "@electron/remote": "^2.0.4", + "@electron/remote": "^2.1.2", "animated-gif-detector": "^1.2.0", "animejs": "3.2.1", "canvas-text-wrapper": "github:cyberj/canvas-text-wrapper#master", @@ -79,7 +79,7 @@ "babel-eslint": "^10.0.3", "babel-loader": "^9.1.2", "core-js": "^3.19.1", - "electron": "25.1.1", + "electron": "29.1.5", "electron-builder": "^22.9.1", "electron-notarize": "^1.2.2", "electron-playwright-helpers": "^1.5.3", diff --git a/public/index.html b/public/index.html index 5c80bd041..07e138b26 100644 --- a/public/index.html +++ b/public/index.html @@ -7,7 +7,6 @@ - modV @@ -20,4 +19,4 @@ - + \ No newline at end of file diff --git a/src/background/menu-bar.js b/src/background/menu-bar.js index f42529193..8ad237937 100644 --- a/src/background/menu-bar.js +++ b/src/background/menu-bar.js @@ -30,6 +30,10 @@ async function save(filePath) { } catch (e) { console.error(e); } + + windows["mainWindow"].setRepresentedFilename(lastFileSavedPath); + windows["mainWindow"].setDocumentEdited(false); + windows["mainWindow"].setTitle(path.basename(lastFileSavedPath)); } async function writePresetToFile(filePath) { @@ -99,6 +103,9 @@ export function generateMenuTemplate() { if (!result.canceled) { const filePath = result.filePaths[0]; openFile(filePath); + windows["mainWindow"].setRepresentedFilename(filePath); + windows["mainWindow"].setDocumentEdited(false); + windows["mainWindow"].setTitle(path.basename(filePath)); } } }, diff --git a/src/background/window-prefs.js b/src/background/window-prefs.js index ed8892fb8..e63a545f2 100644 --- a/src/background/window-prefs.js +++ b/src/background/window-prefs.js @@ -1,4 +1,5 @@ import { app, dialog, ipcMain, screen, BrowserWindow } from "electron"; +import os from "node:os"; import store from "../media-manager/store"; import { autoUpdater } from "electron-updater"; @@ -81,6 +82,10 @@ const windowPrefs = { ipcMain.handle("is-modv-ready", () => modVReady); + window.setRepresentedFilename(os.homedir()); + window.setDocumentEdited(true); + window.setTitle("Untitled"); + // Configure child windows to open without a menubar (windows/linux) window.webContents.on( "new-window", @@ -189,6 +194,7 @@ const windowPrefs = { ipcMain.removeAllListeners("save-file"); ipcMain.removeAllListeners("current-project"); ipcMain.removeAllListeners("input-update"); + ipcMain.removeHandler("is-modv-ready"); } }, diff --git a/tests/e2e/spec/general/rendersTheMainWindow.spec.js b/tests/e2e/spec/general/rendersTheMainWindow.spec.js index 86548526d..0a74cdabc 100644 --- a/tests/e2e/spec/general/rendersTheMainWindow.spec.js +++ b/tests/e2e/spec/general/rendersTheMainWindow.spec.js @@ -5,5 +5,5 @@ test("renders the main window", async () => { const { page } = modVApp; const title = await page.title(); - expect(title).toBe("modV"); + expect(title).toBe("Untitled"); }); diff --git a/yarn.lock b/yarn.lock index 33ed2708a..ec4700d4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1077,10 +1077,10 @@ optionalDependencies: global-agent "^3.0.0" -"@electron/remote@^2.0.4": - version "2.0.10" - resolved "https://registry.yarnpkg.com/@electron/remote/-/remote-2.0.10.tgz#133e2f607b1861ac249bd78b5abd1e961feed713" - integrity sha512-3SFKKaQXcyWgwmibud+UqJl/XlHOgLcI3fwtB9pNelPSJAcTxocOJrF6FaxBIQaj1+R05Di6xuAswZpXAW7xhA== +"@electron/remote@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@electron/remote/-/remote-2.1.2.tgz#52a97c8faa5b769155b649ef262f2f8c851776e6" + integrity sha512-EPwNx+nhdrTBxyCqXt/pftoQg/ybtWDW3DUWHafejvnB1ZGGfMpv6e15D8KeempocjXe78T7WreyGGb3mlZxdA== "@electron/universal@1.0.5": version "1.0.5" @@ -1535,10 +1535,12 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.0.tgz#719498898d5defab83c3560f45d8498f58d11938" integrity sha512-cumHmIAf6On83X7yP+LrsEyUOf/YlociZelmpRYaGFydoaPdxdt80MAbu6vWerQT2COCp2nPvHdsbD7tHn/YlQ== -"@types/node@^18.11.18": - version "18.16.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.18.tgz#85da09bafb66d4bc14f7c899185336d0c1736390" - integrity sha512-/aNaQZD0+iSBAGnvvN2Cx92HqE5sZCPZtx2TsK+4nvV23fFe09jVDvpArXr2j9DnYlzuU9WuoykDDc6wqvpNcw== +"@types/node@^20.9.0": + version "20.11.30" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.30.tgz#9c33467fc23167a347e73834f788f4b9f399d66f" + integrity sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw== + dependencies: + undici-types "~5.26.4" "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -5141,13 +5143,13 @@ electron-updater@^4.3.1: lodash.isequal "^4.5.0" semver "^7.3.5" -electron@25.1.1: - version "25.1.1" - resolved "https://registry.yarnpkg.com/electron/-/electron-25.1.1.tgz#b7aaf0d66a56fbbbad987c13cee108642f63bd50" - integrity sha512-WvFUfVsJn6YiP35UxdibYVjU2LceastyMm4SVp2bmb4XvKEvItAIiwxgm7tPC5Syl1243aRCvQLqr84sZ71pyQ== +electron@29.1.5: + version "29.1.5" + resolved "https://registry.yarnpkg.com/electron/-/electron-29.1.5.tgz#b745b4d201c1ac9f84d6aa034126288dde34d5a1" + integrity sha512-1uWGRw/ffA62lcrklxGUgVxVtOHojsg/nwsYr+/F9cVjipZJn8iPv/ABGIIexhmUqWcho8BqfTJ4osCBa29gBg== dependencies: "@electron/get" "^2.0.0" - "@types/node" "^18.11.18" + "@types/node" "^20.9.0" extract-zip "^2.0.1" elegant-spinner@^1.0.1: @@ -12777,6 +12779,11 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc"