Window activation in ozone-wayland is not working in 1.92
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.92.0
- OS Version: Arch Linux (Wayland session in KDE Plasma 6.1.3)
Steps to Reproduce:
- Open a directory with
code [directory path]command - Minimize the opened VSCode window
- Run
code [directory path]again - Activation request is not sent
In ~/.config/code-flags.conf (Arch Linux specific config file), I set following flags to run VSCode with:
--enable-features=UseOzonePlatform
--ozone-platform=wayland
--enable-wayland-ime
"Activation request" here means xdg_activation_v1::activate request in Wayland protocol. When KWin compositor receives that request, it tells the panel to notify user that the window needs attention like below.
(Panel notifying that firefox window needs attention)
Prior to version 1.92, xdg-activation requests were sent, which can be observed by running WAYLAND_DEBUG=client code --log=debug --verbose | grep activation:
$ WAYLAND_DEBUG=client code --log=debug --verbose | grep activation
...
[3516383.227] -> [email protected]_serial(14320, wl_seat@10)
[3516383.231] -> [email protected]()
[3516387.191] [email protected]("not-granted-666")
[3516387.212] -> [email protected]("not-granted-666", wl_surface@31)
[3516387.216] -> [email protected]()
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.92.1. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
I already upgraded to 1.92.1 and the issue still happens. Then I reinstalled some recent versions of VSCode and found out 1.91.1 -> 1.92.0 introduced this bug.
Looks like this is a problem of Electron/Chromium. I installed electron 29.4 which VSCode 1.91.1 based on and tried following script:
// In the main process.
const { app, BrowserWindow } = require("electron");
app.whenReady().then(() => {
const win = new BrowserWindow({ width: 800, height: 600 });
win.loadURL("https://github.com");
setTimeout(() => {
app.focus();
console.log("requesting focus");
}, 3000);
});
By running WAYLAND_DEBUG=client electron29 --enable-features=UseOzonePlatform --ozone-platform=wayland main.js, I confirmed activation requests are sent. However, they are not sent with the latest version (31.3) of Electron.
Feel free to close this issue as this is not a problem of VSCode itself.
pinging @deepak1556
This one should be fixed by the combination of #218245 (Electron added activation protocol support in v32.1.0) and #218245 (which fixed the app_id so the compositor knows which window to open in front of).
CC @deepak1556
/fixedWith https://github.com/microsoft/vscode/commit/8422282f04e8401240d4bd2d1a1184d97080812e
Hello! Can you give this a try with the Insiders build and let us know if the issue is fixed?
Hello! Can you give this a try with the Insiders build and let us know if the issue is fixed?
I tried the insider build and confirmed the issue is fixed. Thank you all for working on this!