Skip to content

macOS 27 packaged WKWebView + NSGlassEffectView: DirectTouch objc_initWeak and custom-protocol objc_storeWeak SIGABRT #229

Description

@hongguang121

Moved from #198 at @FabianLars's request. This is not the corner-radius / edge-alignment bug.

On macOS 27.0 (26A428), Apple M1, Tauri 2.11.2 / wry 0.55.1 / tao 0.35.2, a packaged .app (npm run tauri:build, custom-protocol on) with:

  • transparent: true, titleBarStyle: Overlay, decorations: true, resizable: true
  • one public NSGlassEffectView inserted as a theme-frame sibling behind the Tao/WK host (not a WK subview; not live addSubview on resize)

hits two separate AppKit Namespace OBJC SIGABRTs. tauri dev with the same glass view does not.

I am not asking window-vibrancy to swizzle DirectTouch or Gesture-Fusion. These look like AppKit/WebKit crashes that apply_liquid_glass / the 0.8 content_view reparent will hit on packaged Tauri windows. Related: PR #199, Tauri PR #14454.

Environment

Machine MacBookPro17,1 (Apple M1)
OS macOS 27.0 (26A428), User
Window transparent: true, decorations: true, titleBarStyle: Overlay, resizable: true
Glass one NSGlassEffectView sibling behind the Tao/WK host, insert once
Stack Tauri 2.11.2, wry 0.55.1, tao 0.35.2, WKWebView

Crash 1 — native resize (fromServer:YES)

Incident Identifier: 00238567-94AA-41AB-91CA-689FB9EAF214
IPS: aether-agent-2026-09-14-100015.ips (happy to attach)

objc_initWeak → swift_unknownObjectWeakInit
_NSViewLayout → -[NSWindow _layoutViewTree]
-[NSWindow _oldPlaceWindow:fromServer:]
-[NSWindow _resizeChangedForDirectTouch:locationInWindow:incrementalDelta:modifierFlags:]
-[_NSGFGestureEnvironment _updateGestureRecognizer:]

Termination: Namespace OBJC, Code 1. There is no application frame between _NSViewLayout and objc_initWeak.

CSS overlay setSize handles cannot intercept this: DirectTouch is dispatched from -[NSWindow sendEvent:] before WK.

Crash 2 — custom-protocol first paint

Incident Identifier: 8F80BDC0-2F0A-4768-A7EC-CBF7E03BC305
IPS: aether-agent-2026-09-14-152837.ips (happy to attach)

objc_storeWeak
-[NSWindow _setFirstResponderIvar:]
-[NSWindow _realMakeFirstResponder:]
WebKit::WebURLSchemeHandlerCocoa::platformStartTask

Same Namespace OBJC abort. Dev loads HTTP devUrl; packaged loads via WKURLSchemeHandler. That is why debug is clean and the .app is not.

Why this matters for 0.8 / Tauri 2.12

PR #199 / the README tell apps to reparent WKWebView into the glass contentView. On tao 0.35 that is extra-unsafe (TaoView taoState / ViewState.ns_window is an objc2::rc::Weak; live reparent + mouseMoved: can objc_loadWeakRetained SIGSEGV).

Even without reparenting — glass as a behind-WK sibling, insert once — packaged DirectTouch layout still aborts inside the glass Swift subtree. So sibling vs content_view is not a fix for crash 1.

Please do not treat “put WK inside NSGlassEffectView.contentView” as a safe default for packaged Tauri windows on macOS 27 until this is understood. Apple Feedback Assistant reports are drafted; FB numbers in a follow-up if/when they exist.

Does not reproduce

  • tauri dev / HTTP devUrl + JS setSize (_setFrameCommon:fromServer:NO)
  • Packaged build without NSGlassEffectView in the theme frame (standard AppKit chrome + CSS-only glass). Native resize then works.

Minimal reproduction

  1. Empty Tauri 2.11.2 project. Keep custom-protocol (what tauri build uses).
  2. Window config:
{
  "decorations": true,
  "titleBarStyle": "Overlay",
  "hiddenTitle": true,
  "transparent": true,
  "resizable": true
}
  1. Insert one NSGlassEffectView as a sibling behind the existing content view. Do not reparent WKWebView into the glass contentView. Do not addSubview again on resize.
  2. npm run tauri:build. Fully quit any previous Dock copy. Launch the .app.
  3. If it dies on first paint → crash 2. If it launches, drag a native window edge → crash 1.

We currently ship packaged builds without NSGlassEffectView (CSS glass only) for this reason.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions