illixion / vscode-vibrancy-continued

Enable Acrylic/Glass effect for your VS Code.
MIT License
506 stars 27 forks source link

[Bug] VSCode 1.86.0-insider is incompatible #116

Closed illixion closed 6 months ago

illixion commented 7 months ago

This version is currently causing Vibrancy to not work on macOS (Windows unconfirmed)

Version: 1.86.0-insider
Commit: 02b90714767f05c734ac29a64d0e5b4768f532d8
Date: 2023-12-08T11:53:33.171Z
Electron: 27.1.3
ElectronBuildId: 25612240
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.1.0

Likely cause is Electron 27: https://github.com/illixion/vscode-vibrancy-continued/issues/116#issuecomment-1864571419

nufrankz commented 6 months ago

On Windows 10 also :(

Version: 1.86.0-insider (user setup)
Commit: 37fe2d06d65db4b50303c5f5e8ca589a50f2287a
Date: 2023-12-15T05:36:59.071Z
Electron: 27.1.3
ElectronBuildId: 25612240
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Windows_NT x64 10.0.19045

Windows 10 22H2 (SO compilation 19045.3803)

RoyalFoxy commented 6 months ago

I have created an issue a few months back about a bug regarding vibrancy in electron and created a standalone fiddle for the basic use case. I tested the same fiddle, that was created with version 25.x.x, with the same 27.1.3 version of electron and it seems like it's not an issue of this extension, nor vscodes but electrons/chromiums fault. The code regarding vibrancy was likely touched as version 26.0.0 "works" as it used to.

The fiddle I created some time ago and the issue.

illixion commented 6 months ago

That's unfortunate, thanks for the valuable info @RoyalFoxy

RoyalFoxy commented 6 months ago

I have created an issue on the electron github repo regarding this. I found out that all version above version 26.6.2 aka version 27.x.y up to alpha versions of 29 are affected by this so there has been introduced a breaking change in the codebase for the 27th major release of electron and it likely hasn't been touched again ever since. I've also noticed that version 26.3.0 also had a change done to the part of the codebase that is responsible for the vibrancy effect as it had a difference in rendering the actual window vibrancy, this however, at least I hope so, is not related to our problem here.

RoyalFoxy commented 6 months ago

I have found the likely issue as someone from the electron team pointed out that dark and thus also light I assume are not supported anymore in 27 and up. I've already found a list of vibrancy modes that work on electron natively fullscreen-ui, header, hud, menu, popover, selection, sidebar, titlebar, tooltip, under-window and 2 seem good for this extensions purpose: fullscreen-ui & under-window. I hope this helps

EDIT: I assume under-window is better as fullscreen-ui has no darkening effect whatsoever

illixion commented 6 months ago

Thank you for the tip @RoyalFoxy, I've tested both and I agree, under-window seems to be a close match. They also seem to work in the current release VSCode version, meaning that updating the default to under-window now would likely not cause issues. I've released v1.1.25 that includes those two types, will look into updating the defaults later.

illixion commented 6 months ago

Released v1.1.26 that includes all currently available BrowserWindow Electron types, prepared the code for Electron 27 and updated the default theme types. I've tested all available types and it appears that there is no more Light type anymore, selection is the closest alternative but it's more grayish and doesn't work with existing themes. Will track this in #121, but for now VSCode 1.86 can be considered compatible.

RoyalFoxy commented 5 months ago

@illixion Unsure what you mean by there is no more Light type anymore. All new vibrancy types are now refactored to be both compatible with light and dark mode and switches automatically with the system theme. There's nothing for you to do as it works out of the box.

illixion commented 5 months ago

@RoyalFoxy You're right, didn't realize that window.systemColorTheme is set to dark in my configuration, can confirm light mode does work properly without it

Art-Chen commented 5 months ago

Look like the issue found at version 1.85.2. This is the latest VSCode Public Release for macOS and it's before 1.86.0. Module Version is v1.1.27. installed vibrancy effect after updated vscode, the Window has light vibrancy effect, but my VSCode color config is set to dark/Tokyo Night Storm. image

Change System Color Theme to Dark(Currently i'm using auto dark/light mode), the vibrancy is return normal dark.

Switch back to 'dark' mode also solved this issue(This marked deleted after version 1.86.0). look like the auto mode can not dynamic set the dark / under-window mode after/before 1.86.0 or under-window will broken dark vibrancy if system is light mode

Art-Chen commented 5 months ago

And on Windows Version, the Vibrancy is not working on 1.86.0-insider when using auto mode.

illixion commented 5 months ago

System dark/light mode currently has to match the Default Dark/Light theme in VSCode since automatic switching isn't yet implemented (#51). We could probably force dark/light mode in VSCode through window.systemColorTheme config setting based on the chosen theme, which would mitigate this issue. Will implement this in an update soon

Art-Chen commented 5 months ago

System dark/light mode currently has to match the Default Dark/Light theme in VSCode since automatic switching isn't yet implemented (#51). We could probably force dark/light mode in VSCode through window.systemColorTheme config setting based on the chosen theme, which would mitigate this issue. Will implement this in an update soon

Badly, the Stable Tag 1.85.2 doesn't have window.systemColorTheme config commit. so the stable release users should be switch to deprecated dark mode manually.