NSRequiresAquaSystemAppearance 致系统崩溃的解决方案
发布于 作者:苏南大叔 来源:程序如此灵动~

mac
系统下,在试验electron
异形窗体的时候。意外的发现在mac@mojave
系统下,窗体的顶部存在着一条灰色边框。为了去掉这条边框,苏南大叔根据网帖实践了一下mac
的一个系统属性,叫做NSRequiresAquaSystemAppearance
。
结果是果断悲剧了:不但没有得到想要的去除顶部像素条的效果,还导致了photoshop
崩溃,qq
截图无法使用等一系列问题。
这些奇怪方案NSRequiresAquaSystemAppearance
的出处就是:
导致问题的命令
defaults write -g NSRequiresAquaSystemAppearance -bool Yes
defaults write -g NSRequiresAquaSystemAppearance -bool No
会导致qq截图无法使用,photoshop奔溃等等问题。因为这些现象,无法截图。所以,大家自行脑补吧。
解决方案
defaults delete -g NSRequiresAquaSystemAppearance
系统崩溃后,执行上述命令,重启之后即可生效。
额外参数
据说还有个非全局-g
,而是根据-app
来操作的命令:
defaults write -app [application name] NSRequiresAquaSystemAppearance -bool No
defaults delete -app [application name] NSRequiresAquaSystemAppearance
注意:app
名称中的空格,请使用\
代替。例如:
defaults write -app Visual\ Studio\ Code NSRequiresAquaSystemAppearance -bool No
总结
这个命令,过于强大,要不不生效,要不效果不好,要不就是导致系统崩溃。所以,强烈建议大家不要试用。
更多mac
系统使用经验文字,请点击苏南大叔的文章:


