diff --git a/src/main/index.ts b/src/main/index.ts index d67a8f0189..e53fbb4b42 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -6,7 +6,7 @@ import { app } from 'electron' import installExtension, { REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } from 'electron-devtools-installer' import Logger from 'electron-log' -import { isDev } from './constant' +import { isDev, isWin } from './constant' import { registerIpc } from './ipc' import { configManager } from './services/ConfigManager' import mcpService from './services/MCPService' @@ -24,6 +24,16 @@ import { setUserDataDir } from './utils/file' Logger.initialize() +/** + * Disable chromium's window animations + * main purpose for this is to avoid the transparent window flashing when it is shown + * (especially on Windows for SelectionAssistant Toolbar) + * Know Issue: https://github.com/electron/electron/issues/12130#issuecomment-627198990 + */ +if (isWin) { + app.commandLine.appendSwitch('wm-window-animations-disabled') +} + // in production mode, handle uncaught exception and unhandled rejection globally if (!isDev) { // handle uncaught exception