mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-20 02:18:01 +00:00
started separating terminus-electron and terminus-web
This commit is contained in:
@@ -7,6 +7,12 @@ import { Window, WindowOptions } from './window'
|
||||
import { pluginManager } from './pluginManager'
|
||||
import { PTYManager } from './pty'
|
||||
|
||||
/* eslint-disable block-scoped-var */
|
||||
|
||||
try {
|
||||
var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires, no-var
|
||||
} catch (_) { }
|
||||
|
||||
export class Application {
|
||||
private tray?: Tray
|
||||
private ptyManager = new PTYManager()
|
||||
@@ -14,6 +20,7 @@ export class Application {
|
||||
|
||||
constructor () {
|
||||
remote.initialize()
|
||||
this.useBuiltinGraphics()
|
||||
this.ptyManager.init(this)
|
||||
|
||||
ipcMain.on('app:config-change', (_event, config) => {
|
||||
@@ -161,6 +168,16 @@ export class Application {
|
||||
this.windows[this.windows.length - 1].passCliArguments(argv, cwd, true)
|
||||
}
|
||||
|
||||
private useBuiltinGraphics (): void {
|
||||
if (process.platform === 'win32') {
|
||||
const keyPath = 'SOFTWARE\\Microsoft\\DirectX\\UserGpuPreferences'
|
||||
const valueName = app.getPath('exe')
|
||||
if (!wnr.getRegistryValue(wnr.HK.CU, keyPath, valueName)) {
|
||||
wnr.setRegistryValue(wnr.HK.CU, keyPath, valueName, wnr.REG.SZ, 'GpuPreference=1;')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private setupMenu () {
|
||||
const template: MenuItemConstructorOptions[] = [
|
||||
{
|
||||
|
@@ -122,7 +122,7 @@ export class Window {
|
||||
}
|
||||
})
|
||||
|
||||
this.window.loadURL(`file://${app.getAppPath()}/dist/index.html?${this.window.id}`, { extraHeaders: 'pragma: no-cache\n' })
|
||||
this.window.loadURL(`file://${app.getAppPath()}/dist/index.html`, { extraHeaders: 'pragma: no-cache\n' })
|
||||
|
||||
this.window.webContents.setVisualZoomLevelLimits(1, 1)
|
||||
this.window.webContents.setZoomFactor(1)
|
||||
@@ -297,6 +297,8 @@ export class Window {
|
||||
this.window.webContents.send('start', {
|
||||
config: this.configStore,
|
||||
executable: app.getPath('exe'),
|
||||
windowID: this.window.id,
|
||||
isFirstWindow: this.window.id === 1,
|
||||
})
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user