From 3bba862bb6ccf7656c1c2521a9a8f6eee996f9a7 Mon Sep 17 00:00:00 2001 From: fullex <106392080+0xfullex@users.noreply.github.com> Date: Wed, 4 Jun 2025 19:07:07 +0800 Subject: [PATCH] fix: transparent window flashing when show (#6755) * fix: avoid SelectionAssistant toolbar flashing * add comments --- src/main/index.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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