让macOS一贯糟糕(非讽刺)
Make macOS consistently bad unironically

原始链接: https://lr0.org/blog/p/macos/

## macOS 26 圆角半径困扰 macOS 26 的升级带来了明显圆润的窗口角落,引发了关于其美观性的争论——尤其是在设计上与 YouTube 的界面等趋势相似。作者认为,这些圆角在不同应用程序中的*不一致性*比圆润本身更令人不适,这是用户中常见的抱怨。 为了解决这个问题,作者详细介绍了一种技术解决方法,即禁用系统完整性保护 (SIP) 来修改负责角落渲染的系统库。虽然承认禁用 SIP 存在安全隐患,但他们认为对于已经受到损害的系统来说,风险很小。 作者的解决方案不是消除圆润,而是*增加*圆润度,旨在使所有应用程序的圆角保持一致。他们提供代码——一个动态库和一个启动代理——来“交换”macOS 中的圆角半径值,从而有效地覆盖默认设置。这需要编译、签名和部署库,然后在系统启动时加载它。最终结果? 一致的圆角(对作者来说,也更令人接受)。

相关文章

原文

Alongside the various bugs you get, one of the issues of upgrading to MacOS 26 is that it has one of the most notorious inconsistency issues in windows corners. I'm not sure what exactly pushes product designers to like the excessive roundness1. One of the ugliest roundness examples I've ever seen is the current one in the YouTube UI design. I believe that UI design is the most influential field ever since designers just try to follow whatever big companies do (in fact I see this a lot in my work, when two designers are having an argument, one of them would resolve it to, let's see how apple draw that button), which means that we are probably going to see this ugly effect elsewhere very soon.

../i/2026-03-27_19-51-20_screenshot.png Anyway, many I had to upgrade recently to MacOS 26 too. And I found the edges ugly, like everyone else did. However, what's even uglier, is the inconsistency. Many people try to resolve this by disabling MacOS system integrity, which results in making them possibly vulnerable2. Arguable, since you just loose security over /root, which is not a big deal if someone already gained access to your machine, at least for me.. The reason why you need to disable SIP, is that to edit the dynamic libraries that system apps like Safari (which has crazy bad corners) use, you need to edit under the root. To me though, I don't find the corners so bad, but I find the inconsistency very annoying. So I think a better solution to this is; instead of making everything roundless, make everything more rounded. I forked a solution that makes things roundless to modify it to have my approach. It's simply as follows:

#import <AppKit/AppKit.h>
#import <objc/runtime.h>

static CGFloat kDesiredCornerRadius = 23.0;

static double swizzled_cornerRadius(id self, SEL _cmd) {
    return kDesiredCornerRadius;
}

static double swizzled_getCachedCornerRadius(id self, SEL _cmd) {
    return kDesiredCornerRadius;
}

static CGSize swizzled_topCornerSize(id self, SEL _cmd) {
    return CGSizeMake(kDesiredCornerRadius, kDesiredCornerRadius);
}

static CGSize swizzled_bottomCornerSize(id self, SEL _cmd) {
    return CGSizeMake(kDesiredCornerRadius, kDesiredCornerRadius);
}

__attribute__((constructor))
static void init(void) {
    // Only apply to third-party GUI apps; skip CLI tools, daemons, and Apple system apps
    NSString *bid = [[NSBundle mainBundle] bundleIdentifier];
    if (!bid || [bid hasPrefix:@"com.apple."]) return;

    Class cls = NSClassFromString(@"NSThemeFrame");
    if (!cls) return;

    Method m1 = class_getInstanceMethod(cls, @selector(_cornerRadius));
    if (m1) method_setImplementation(m1, (IMP)swizzled_cornerRadius);

    Method m2 = class_getInstanceMethod(cls, @selector(_getCachedWindowCornerRadius));
    if (m2) method_setImplementation(m2, (IMP)swizzled_getCachedCornerRadius);

    Method m3 = class_getInstanceMethod(cls, @selector(_topCornerSize));
    if (m3) method_setImplementation(m3, (IMP)swizzled_topCornerSize);

    Method m4 = class_getInstanceMethod(cls, @selector(_bottomCornerSize));
    if (m4) method_setImplementation(m4, (IMP)swizzled_bottomCornerSize);
}

Then compile, sign, and store:

clang -arch arm64e -arch x86_64 -dynamiclib -framework AppKit \
  -o SafariCornerTweak.dylib \
  SafariCornerTweak.m

sudo mkdir -p /usr/local/lib/
sudo cp SafariCornerTweak.dylib /usr/local/lib/
sudo codesign -f -s - /usr/local/lib/SafariCornerTweak.dylib
cp com.local.dyld-inject.plist ~/Library/LaunchAgents/com.local.dyld-inject.plist

You can have this plist too to load it in once your computer loads:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.local.dyld-inject</string>
  <key>ProgramArguments</key>
  <array>
    <string>launchctl</string>
    <string>setenv</string>
    <string>DYLD_INSERT_LIBRARIES</string>
    <string>/usr/local/lib/SafariCornerTweak.dylib</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>

Load it:

launchctl load ~/Library/LaunchAgents/com.local.dyld-inject.plist

Now at least everything is consistently bad. #Programming

联系我们 contact @ memedata.com