Microsoft/vscode

Windows: unable to bring window to front even when trying to steal focus

Open

#251,849 创建于 2025年6月18日

在 GitHub 查看
 (3 评论) (1 反应) (1 负责人)TypeScript (74,848 star) (10,221 fork)batch import
bugconfirmedelectronhelp wantedupstreamworkbench-window

描述

  • VS Code Version: 1.101.0
  • OS Version: Windows 11 Pro (26100.4349)

Steps to Reproduce:

  1. I am developing a vscode extension. The VSCode extension spawns a child process, and debugs said process. In windows I see that after I hit the breakpoint, the vscode can not become the current foreground windows, and only flashes on the windows status bar. (same repro as this old issue)

  2. I have verified the breakpoint in the below image hits in the F1 debugger, and routes down correctly into the electron API. Image

There are several solutions suggested on the electron issues board that could solve the problem for vscode. The final suggested solution, in short: minimize, show, setAlwaysOnTop, THEN focus.

贡献者指南