Skip to content

Commit 460ed5e

Browse files
committed
Merge branch 'dev'
2 parents 9e57700 + 929601b commit 460ed5e

5 files changed

Lines changed: 21 additions & 44 deletions

File tree

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"clean-webpack-plugin": "^3.0.0",
7070
"copy-webpack-plugin": "^6.1.0",
7171
"css-loader": "^4.3.0",
72-
"electron": "^12.2.1",
72+
"electron": "^13.6.3",
7373
"electron-builder": "^22.10.4",
7474
"electron-rebuild": "^2.3.4",
7575
"electron-webpack": "^2.8.2",

src/main/window/WindowManager.ts

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class WindowManager {
150150
if (Array.isArray(tabs) && tabs.length) {
151151
tabs.forEach((tab, i) => {
152152
setTimeout(() => {
153-
this.addTab("loadContent.js", tab.url, tab.title, false);
153+
this.addTab("loadContent.js", tab.url, tab.title);
154154
}, 500 * i);
155155
});
156156

@@ -308,7 +308,7 @@ class WindowManager {
308308
url = `${url}${args[2]}`;
309309
}
310310

311-
this.addTab("loadContent.js", url, undefined, false);
311+
this.addTab("loadContent.js", url);
312312
});
313313
E.ipcMain.on("setFeatureFlags", (_, args) => {
314314
storage.setFeatureFlags(args.featureFlags);
@@ -660,36 +660,24 @@ class WindowManager {
660660
return false;
661661
};
662662

663-
public addTab = (
664-
scriptPreload = "loadMainContent.js",
665-
url = Const.RECENT_FILES,
666-
title?: string,
667-
focused = true,
668-
): E.BrowserView => {
663+
public addTab = (scriptPreload = "loadMainContent.js", url = Const.RECENT_FILES, title?: string): E.BrowserView => {
669664
const userId = storage.get().userId;
670665
const tab = Tabs.newTab(`${url}?fuid=${userId}`, this.getBounds(), scriptPreload);
671666

672-
if (focused) {
673-
this.focusTab(tab.view.webContents.id);
674-
}
675-
676667
tab.view.webContents.on("will-navigate", this.onMainWindowWillNavigate);
677668
tab.view.webContents.on("new-window", this.onNewWindow);
678669

679670
MenuState.updateActionState(Const.ACTIONTABSTATE);
680671

672+
this.mainWindow.addBrowserView(tab.view);
673+
this.mainWindow.setTopBrowserView(this.mainTab);
681674
this.mainWindow.webContents.send("didTabAdd", {
682675
id: tab.view.webContents.id,
683676
url,
684677
showBackBtn: true,
685678
title,
686-
focused,
687679
});
688680

689-
if (focused) {
690-
this.focusTab(tab.view.webContents.id);
691-
}
692-
693681
tab.view.webContents.session.setPermissionRequestHandler((webContents, permission, cb) => {
694682
if (permission === "media") {
695683
if (tab.micAccess) {
@@ -724,7 +712,8 @@ class WindowManager {
724712
const url = `${Const.RECENT_FILES}/?fuid=${userId}`;
725713
const tab = Tabs.newTab(url, this.getBounds(), "loadMainContent.js", false);
726714

727-
this.mainWindow.setBrowserView(tab.view);
715+
this.mainWindow.addBrowserView(tab.view);
716+
this.mainWindow.setTopBrowserView(tab.view);
728717

729718
tab.view.webContents.on("will-navigate", this.onMainTabWillNavigate);
730719
tab.view.webContents.on("will-navigate", this.onMainWindowWillNavigate);
@@ -738,30 +727,17 @@ class WindowManager {
738727
};
739728

740729
public focusTab = (webContentsId: number): void => {
741-
const tabs = Tabs.getAll();
742-
743-
tabs.forEach(tab => {
744-
this.mainWindow.removeBrowserView(tab.view);
745-
});
746-
747730
const neededTab = Tabs.getByWebContentId(webContentsId);
748731

749732
if (!neededTab) {
750-
this.mainWindow.addBrowserView(this.mainTab);
733+
this.mainWindow.setTopBrowserView(this.mainTab);
751734
this.lastFocusedTab = this.mainTab.webContents;
752735

753736
return;
754737
}
755738

756-
this.mainWindow.addBrowserView(neededTab.view);
739+
this.mainWindow.setTopBrowserView(neededTab.view);
757740
this.lastFocusedTab = neededTab.view.webContents;
758-
759-
// Ugly hack for rerender BrowserView
760-
setTimeout(() => {
761-
this.mainWindow.removeBrowserView(neededTab.view);
762-
this.mainWindow.addBrowserView(neededTab.view);
763-
this.lastFocusedTab = neededTab.view.webContents;
764-
}, 500);
765741
};
766742

767743
private initSettingsView = () => {

src/middleware/ThemesManager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export class ThemesManager {
9595
"#react-page { background-color: var(--bg-panel); }",
9696
`span[class*="action_option--shortcut"] { color: var(--fg-overlay); }`,
9797
`div[class*="search--searchContainer"] input { background-color: var(--bg-panel) !important; }`,
98+
`div[class*="file_browser_page_view"] { background-color: var(--bg-panel) !important; }`,
9899
];
99100

100101
this.setThemeVariables();

src/middleware/webBinding.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface IntiApiOptions {
99
fileBrowser: boolean;
1010
}
1111

12-
const API_VERSION = 48;
12+
const API_VERSION = 53;
1313
let webPort: MessagePort;
1414
const mainProcessCancelCallbacks: Map<number, () => void> = new Map();
1515

0 commit comments

Comments
 (0)