fix: fix main-window fake show up in Wayland KDE

This commit is contained in:
ZhuangYumin 2025-04-09 00:03:34 +08:00 committed by 亢奋猫
parent 3674cc4afe
commit 9689f00214

View File

@ -319,10 +319,18 @@ export class WindowService {
//[macOS] Known Issue //[macOS] Known Issue
// setVisibleOnAllWorkspaces true/false will NOT bring window to current desktop in Mac (works fine with Windows) // 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 // AppleScript may be a solution, but it's not worth
// [Linux] Known Issue
// setVisibleOnAllWorkspaces 在 Linux 环境下(特别是 KDE Wayland会导致窗口进入"假弹出"状态
// 因此在 Linux 环境下不执行这两行代码
if (!isLinux) {
this.mainWindow.setVisibleOnAllWorkspaces(true) this.mainWindow.setVisibleOnAllWorkspaces(true)
}
this.mainWindow.show() this.mainWindow.show()
this.mainWindow.focus() this.mainWindow.focus()
if (!isLinux) {
this.mainWindow.setVisibleOnAllWorkspaces(false) this.mainWindow.setVisibleOnAllWorkspaces(false)
}
} else { } else {
this.mainWindow = this.createMainWindow() this.mainWindow = this.createMainWindow()
} }