Skip to content

Commit e648061

Browse files
committed
Allow frameless window to be disabled on Windows
1 parent 54c8791 commit e648061

File tree

8 files changed

+28
-4
lines changed

8 files changed

+28
-4
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@ Maintenance of this project is made possible by all the <a href="https://github.
2626

2727
# ❗️ Important notice for Windows 10/11 users
2828

29-
### tl;dr YOU WON'T BE ABLE TO RESIZE THE VSCODE WINDOW unless you downgrade VSCode to 1.85.2
29+
### tl;dr YOU WON'T BE ABLE TO RESIZE THE VSCODE WINDOW unless you do this
3030

31-
VSCode 1.86 and newer has known issues on Windows 10/11 due to breaking changes in Electron 27. Your VSCode windows **may stop being resizable, snappable or maximizable** if Vibrancy is applied on Windows, and you must also use "custom" for `window.titleBarStyle` setting. Some users have reported that [AltSnap](https://github.com/RamonUnch/AltSnap) may be able to solve this issue.
31+
By default, when Vibrancy is installed on VSCode 1.86 and newer on Windows, your VSCode windows **may stop being resizable, snappable or maximizable**. This is a known issue related to VSCode 1.86 and Electron 27 and it occurs due to hardware acceleration leading to distorted text. Vibrancy will by default apply a mitigation that enables frameless windows, but this also causes issues with window interaction.
3232

33-
If this is undesired, **please downgrade to VSCode 1.85.2**, which can be downloaded using this URL: https://update.code.visualstudio.com/1.85.2/win32-x64-user/stable
33+
The correct process to install Vibrancy on Windows is:
34+
35+
1. Update your VSCode shortcut to include `--disable-gpu-compositing` at the end of "Target" field, for example: `"C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe" --disable-gpu-compositing`
36+
2. (optional) Update your shell configuration to add the same argument to `code`, needed if VSCode isn't running when you use `code`
37+
3. Install Vibrancy Continued
38+
4. Go to settings and check **Disable frameless window** (`vscode_vibrancy.disableFramelessWindow`)
39+
5. Press F1 and select **Reload Vibrancy**
3440

3541
**Instructionds for removing Vibrancy** can be found here: [How to uninstall Vibrancy](#how-to-uninstall-vibrancy)
3642

@@ -110,6 +116,10 @@ Use a new method for preventing window flashing during resizing. Eliminates the
110116

111117
*boolean, default is true*
112118

119+
#### Disable Frameless Window (`vscode_vibrancy.disableFramelessWindow`)
120+
121+
Disable frameless window, which is a mitigation that fixes a GPU-related render bug on Windows with VSCode 1.86 and newer. You may see distorted and blurry graphics if you disable this mitigation with an affected GPU. Running VSCode with a `--disable-gpu-compositing` argument, such as via a shortcut, will allow for this mitigation to be safely disabled.
122+
113123
#### Refresh interval (`vscode_vibrancy.refreshInterval`)
114124

115125
Refresh interval (in milliseconds) for making the background transparent after window resizing. Lower values make the update less visible at the cost of increased CPU utilization. **Ignored when using "Prevent Flash" method.**

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 1.1.51
22

33
* Reduced package size to ~1 MB by not bundling dev dependencies
4+
* Allow frameless window mitigation to be disabled, which when combined with `--disable-gpu-compositing` on Windows resolves the issue with blurry text on VSCode 1.86 and newer
45

56
# 1.1.50
67

extension/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ function activate(context) {
375375

376376
// BrowserWindow option modification
377377
async function modifyElectronJSFile(ElectronJSFile) {
378+
const config = vscode.workspace.getConfiguration("vscode_vibrancy");
378379
let ElectronJS = await fs.readFile(ElectronJSFile, 'utf-8');
379380

380381
// add visualEffectState option to enable vibrancy while VSCode is not in focus (macOS only)
@@ -384,7 +385,7 @@ function activate(context) {
384385

385386
// enable frameless window on Windows w/ Electron 27 (bug #122)
386387
const electronMajorVersion = parseInt(process.versions.electron.split('.')[0]);
387-
if (!ElectronJS.includes('frame:false,') && process.platform === 'win32' && electronMajorVersion >= 27) {
388+
if (!config.disableFramelessWindow && !ElectronJS.includes('frame:false,') && process.platform === 'win32' && electronMajorVersion >= 27) {
388389
ElectronJS = ElectronJS.replace(/experimentalDarkMode/g, 'frame:false,transparent:true,experimentalDarkMode');
389390
}
390391

nls-schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
"configuration.preventFlash.description": {
3333
"type": "string"
3434
},
35+
"configuration.disableFramelessWindow.description": {
36+
"type": "string"
37+
},
3538
"extension.installVibrancy.title": {
3639
"type": "string"
3740
},
@@ -110,6 +113,7 @@
110113
"configuration.imports.description",
111114
"configuration.refreshInterval.description",
112115
"configuration.preventFlash.description",
116+
"configuration.disableFramelessWindow.description",
113117
"extension.installVibrancy.title",
114118
"extension.uninstallVibrancy.title",
115119
"extension.updateVibrancy.title",

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@
191191
"description": "%configuration.preventFlash.description%",
192192
"type": "boolean",
193193
"default": true
194+
},
195+
"vscode_vibrancy.disableFramelessWindow": {
196+
"description": "%configuration.disableFramelessWindow.description%",
197+
"type": "boolean",
198+
"default": false
194199
}
195200
}
196201
}

package.nls.ja.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"configuration.imports.description": "インポートする CSS/JS ファイルのパスを指定します。",
1212
"configuration.refreshInterval.description": "ウィンドウの透明性のための間隔を更新します。 値が低いと、更新が目立たなくなりますが、CPUの使用量が増加します。",
1313
"configuration.preventFlash.description": "別の方法で画面サイズ変更時のフラッシュを防止します。更新間隔が不要になりますが、互換性が低下する場合もあります。",
14+
"configuration.disableFramelessWindow.description": "これは、VSCode 1.86以降のWindowsにおけるGPU関連のレンダリングバグを修正する緩和策です。影響を受けるGPUでこの緩和策を無効にすると、グラフィックスが歪んだりぼやけたりすることがあります。ショートカットなどで--disable-gpu-compositing引数を指定してVSCodeを実行すると、この緩和策を安全に無効にすることができます。",
1415
"extension.installVibrancy.title": "Vibrancy を有効化",
1516
"extension.uninstallVibrancy.title": "Vibrancy を無効化",
1617
"extension.updateVibrancy.title": "Vibrancy を再読み込み",

package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"configuration.imports.description": "Import CSS/JS files, as file paths.",
1212
"configuration.refreshInterval.description": "Refresh interval (in milliseconds) for making the background transparent after window resizing. Lower values make the update less visible at the cost of increased CPU utilization.",
1313
"configuration.preventFlash.description": "Use an alternative method to prevent window flashing when resizing. Eliminates the need for a refresh interval, but may be less compatible in some cases.",
14+
"configuration.disableFramelessWindow.description": "Disable frameless window, which is a mitigation that fixes a GPU-related render bug on Windows with VSCode 1.86 and newer. You may see distorted and blurry graphics if you disable this mitigation with an affected GPU. Running VSCode with a --disable-gpu-compositing argument, such as via a shortcut, will allow for this mitigation to be safely disabled.",
1415
"extension.installVibrancy.title": "Enable Vibrancy",
1516
"extension.uninstallVibrancy.title": "Disable Vibrancy",
1617
"extension.updateVibrancy.title": "Reload Vibrancy",

package.nls.zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"configuration.imports.description": "自定义 CSS 或 JS 文件的路径。",
1212
"configuration.refreshInterval.description": "试验性功能:改变背景颜色刷新率以避免在改变窗口大小后出现的闪屏,更改后需要 [卸载 -> 重启 -> 安装 -> 重启]才会生效",
1313
"configuration.preventFlash.description": "另一种启用的途径,可以防止在改变窗口大小时闪屏。启用后不需要“刷新率”设置,但在某些情况下兼容性可能会降低。",
14+
"configuration.disableFramelessWindow.description": "禁用 “无框架窗口”,这是一种缓解措施,可修复 Windows VSCode 1.86 及更新版本上与 GPU 相关的渲染错误。如果使用受影响的 GPU 禁用该缓解措施,您可能会看到扭曲和模糊的图形。使用 --disable-gpu-compositing 参数(例如通过快捷方式)运行 VSCode,可以安全地禁用该缓解措施。",
1415
"extension.installVibrancy.title": "安装毛玻璃效果",
1516
"extension.uninstallVibrancy.title": "卸载毛玻璃效果",
1617
"extension.updateVibrancy.title": "重新安装毛玻璃效果",

0 commit comments

Comments
 (0)