From 9689f00214e7da02a03ca07328bff11f65d30080 Mon Sep 17 00:00:00 2001 From: ZhuangYumin Date: Wed, 9 Apr 2025 00:03:34 +0800 Subject: [PATCH] fix: fix main-window fake show up in Wayland KDE --- src/main/services/WindowService.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/services/WindowService.ts b/src/main/services/WindowService.ts index 1e8d071b..89c96503 100644 --- a/src/main/services/WindowService.ts +++ b/src/main/services/WindowService.ts @@ -319,10 +319,18 @@ export class WindowService { //[macOS] Known Issue // setVisibleOnAllWorkspaces true/false will NOT bring window to current desktop in Mac (works fine with Windows) // AppleScript may be a solution, but it's not worth - this.mainWindow.setVisibleOnAllWorkspaces(true) + + // [Linux] Known Issue + // setVisibleOnAllWorkspaces 在 Linux 环境下(特别是 KDE Wayland)会导致窗口进入"假弹出"状态 + // 因此在 Linux 环境下不执行这两行代码 + if (!isLinux) { + this.mainWindow.setVisibleOnAllWorkspaces(true) + } this.mainWindow.show() this.mainWindow.focus() - this.mainWindow.setVisibleOnAllWorkspaces(false) + if (!isLinux) { + this.mainWindow.setVisibleOnAllWorkspaces(false) + } } else { this.mainWindow = this.createMainWindow() }