mac上花屏问题解决办法

3,139 阅读1分钟

mac上vscode 花屏问题

新型号解决办法:

1、在vscode 内部打开命令面板:Ctrl+Shift+P
2、在搜索框输入:Configure Runtime Arguments并打开
3、在打开的argv.json里面增加:"disable-hardware-acceleration": true

顺序执行上述步骤,保存并退出vscode,重新打开即可

老型号解决办法:

1.cd到VSCode执行程序所在目录
cd /Applications/Visual\ Studio\ Code.app/Contents/MacOS/

2.将Electron(VSCode可以行程序)重名了为Electron.real
mv Electron Electron.real

3.在该目录新建一个文件名为Electron文本文件(没有后缀),并将下面的内容粘贴到文件里
#!/bin/bash
cd "/Applications/Visual Studio Code.app/Contents/MacOS"
"/Applications/Visual Studio Code.app/Contents/MacOS/Electron.real" --disable-gpu

 "$@"

 4.为Electron添加执行权限
 chmod -R a+x Electron

 5.大功告成,现在直接打开vscode已经是禁用gpu了
   可已经将自己创建的Electron文件备份到其他目录
   vscode升级后只需要执行第二部将Electron(VSCode可以行程序)重名了为Electron.real
   然后在把备份的Electron复制到该目录即可

mac上 chrome浏览器花屏问题解决方案(关闭GPU加速):

 1、在地址栏输入chrome://flags
 2、在页面中搜索框中搜索gpu,选中第一个disabled,如下图
 3、关闭重启chrome就可以了