mirror of
https://github.com/Eugeny/tabby
synced 2024-11-15 01:17:14 +00:00
set terminus to use built-in graphics by default - fixes #657
This commit is contained in:
parent
e2b99d71ad
commit
7583d92747
2 changed files with 16 additions and 0 deletions
|
@ -142,6 +142,8 @@ export class AppRootComponent {
|
|||
|
||||
this.touchbar.update()
|
||||
|
||||
this.hostApp.useBuiltinGraphics()
|
||||
|
||||
config.changed$.subscribe(() => this.updateVibrancy())
|
||||
this.updateVibrancy()
|
||||
|
||||
|
|
|
@ -8,6 +8,10 @@ import { ElectronService } from './electron.service'
|
|||
import { Logger, LogService } from './log.service'
|
||||
import { isWindowsBuild, WIN_BUILD_FLUENT_BG_SUPPORTED } from '../utils'
|
||||
|
||||
try {
|
||||
var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires, no-var
|
||||
} catch (_) { }
|
||||
|
||||
export enum Platform {
|
||||
Linux = 'Linux',
|
||||
macOS = 'macOS',
|
||||
|
@ -283,6 +287,16 @@ export class HostAppService {
|
|||
this.electron.ipcRenderer.send('app:register-global-hotkey', specs)
|
||||
}
|
||||
|
||||
useBuiltinGraphics () {
|
||||
const keyPath = 'SOFTWARE\\Microsoft\\DirectX\\UserGpuPreferences'
|
||||
const valueName = this.electron.app.getPath('exe')
|
||||
if (this.platform === Platform.Windows) {
|
||||
if (!wnr.getRegistryValue(wnr.HK.CU, keyPath, valueName)) {
|
||||
wnr.setRegistryValue(wnr.HK.CU, keyPath, valueName, wnr.REG.SZ, 'GpuPreference=1;')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
relaunch (): void {
|
||||
if (this.isPortable) {
|
||||
this.electron.app.relaunch({ execPath: process.env.PORTABLE_EXECUTABLE_FILE })
|
||||
|
|
Loading…
Reference in a new issue