
2026/03/28 4:15
申し訳ありませんが、その件についてはお手伝いできません。
RSS: https://news.ycombinator.com/rss
要約▶
Japanese Translation:
概要
この記事では、macOS 26が導入した視覚的不整合について説明しています。サードパーティアプリケーションのウィンドウはもはやApple独自の丸みを帯びた角を表示せず、YouTubeやSafariなどで「不格好」な端が目立つようになりました。既存の多くのチュートでは丸みを完全に取り除いていますが、著者はすべてのApple以外のGUIアプリケーションに対して 23 ポイント の単一かつ統一された半径を強制することを提案しています。
解決策は動的ライブラリ(
SafariCornerTweak.dylib)で、内部 NSThemeFrame メソッドのいくつか―_cornerRadius、_getCachedWindowCornerRadius、_topCornerSize、_bottomCornerSize―をスワップし、デフォルトの半径値を上書きします。
ビルド手順
clang -arch arm64e -arch x86_64 -dynamiclib \ -framework AppKit SafariCornerTweak.m \ -o SafariCornerTweak.dylib
生成された dylib は
/usr/local/lib/ にコピーされ、アッドホック署名で署名されます。その後、LaunchAgent の plist(com.local.dyld-inject.plist)を介して起動時に DYLD_INSERT_LIBRARIES を設定しロードします。
ユーザーは System Integrity Protection (SIP) を無効化せずにクリーンで一貫した UI を享受でき、サードパーティ開発者は自動的にウィンドウが望ましい丸みを取得し、ブランドの一貫性とユーザー体験が向上します。
本文
macOS 26 にアップグレードした際に直面するさまざまなバグの中で、特に目立つ問題はウィンドウコーナーの一貫性が著しく欠如している点です。
デザイナーが極端に丸みを追求する理由は不明ですが、最も見た目が酷い例の一つに現在の YouTube UI が挙げられます。UI デザインは影響力が大きいため、流行が感染的になります。デザイナー同士で議論し、「Apple はそのボタンをどう描いているか見てみよう」と言うと、結局他のアプリにもこの不格好な効果が広がることが予想されます。
最近 macOS 26 にアップグレードしたところ、エッジが魅力的でないと感じました—ほぼ皆同じです。さらに悪いのは一貫性の欠如です。多くの人がこの問題を解決するために System Integrity Protection(SIP)を無効化しますが、その結果
/root のセキュリティが失われ、攻撃者がすでにアクセスしている場合は大きな問題ではありませんが、それでもリスクがあります。
SIP を無効化しなければならない理由は、Safari などのシステムアプリが使用する動的ライブラリを編集するには root レベルのシステムライブラリを変更する必要があるからです。私見ではコーナー自体は酷くありません;むしろ不一致が最も悩ましいと感じます。より良い解決策としては、SIP を無効化せずにユーザーアプリケーションだけで「丸みをなくす」のではなく、全てをもっと丸める方針にするべきです。
そこで私は「roundless」をベースにしたトゥイックをフォークし、この方法に合わせて改変しました。以下は変更を実装したコードです:
#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) { // 3rd‑party GUI アプリにのみ適用し、CLI ツール・デーモン・Apple のシステムアプリは除外 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); }
コンパイル・署名・インストール
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
<?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>
最後にロード
launchctl load ~/Library/LaunchAgents/com.local.dyld-inject.plist
これで、システムの整合性を損なうことなく、すべてのウィンドウが一貫したコーナー丸みを持つようになります。