mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 11:44:28 +08:00
fix: [Linux] support Linux Wayland global shortcuts (#8080)
feat: support Linux Wayland global shortcuts
This commit is contained in:
parent
186bdb486f
commit
16e65d39be
@ -11,7 +11,7 @@ import { app } from 'electron'
|
||||
import installExtension, { REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } from 'electron-devtools-installer'
|
||||
import Logger from 'electron-log'
|
||||
|
||||
import { isDev, isWin } from './constant'
|
||||
import { isDev, isWin, isLinux } from './constant'
|
||||
import { registerIpc } from './ipc'
|
||||
import { configManager } from './services/ConfigManager'
|
||||
import mcpService from './services/MCPService'
|
||||
@ -46,6 +46,14 @@ if (isWin) {
|
||||
app.commandLine.appendSwitch('wm-window-animations-disabled')
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable GlobalShortcutsPortal for Linux Wayland Protocol
|
||||
* see: https://www.electronjs.org/docs/latest/api/global-shortcut
|
||||
*/
|
||||
if (isLinux && process.env.XDG_SESSION_TYPE === 'wayland') {
|
||||
app.commandLine.appendSwitch('enable-features', 'GlobalShortcutsPortal')
|
||||
}
|
||||
|
||||
// Enable features for unresponsive renderer js call stacks
|
||||
app.commandLine.appendSwitch('enable-features', 'DocumentPolicyIncludeJSCallStacksInCrashReports')
|
||||
app.on('web-contents-created', (_, webContents) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user