Get native theme through IPC not remote

This commit is contained in:
Fedor Indutny 2021-06-30 11:57:43 -07:00 committed by GitHub
parent d2cc8e5aa9
commit 71572db7a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 227 additions and 60 deletions

View file

@ -122,6 +122,7 @@ const {
} = require('./ts/types/Settings');
const { Environment } = require('./ts/environment');
const { ChallengeMainHandler } = require('./ts/main/challengeMain');
const { NativeThemeNotifier } = require('./ts/main/NativeThemeNotifier');
const { PowerChannel } = require('./ts/main/powerChannel');
const { maybeParseUrl, setUrlSearchParams } = require('./ts/util/url');
@ -136,6 +137,9 @@ const systemTraySettingCache = new SystemTraySettingCache(
const challengeHandler = new ChallengeMainHandler();
const nativeThemeNotifier = new NativeThemeNotifier();
nativeThemeNotifier.initialize();
let sqlInitTimeStart = 0;
let sqlInitTimeEnd = 0;
@ -303,6 +307,8 @@ function handleCommonWindowEvents(window) {
window.webContents.on('preload-error', (event, preloadPath, error) => {
console.error(`Preload error in ${preloadPath}: `, error.message);
});
nativeThemeNotifier.addWindow(window);
}
const DEFAULT_WIDTH = 800;