Skip to content

WebView (macOS): remove orphaned contentsScale override (fixes low-DPI blur) - #37

Closed
jakepenn wants to merge 1 commit into
minimal_masterfrom
webview-diag-reset
Closed

WebView (macOS): remove orphaned contentsScale override (fixes low-DPI blur)#37
jakepenn wants to merge 1 commit into
minimal_masterfrom
webview-diag-reset

Conversation

@jakepenn

@jakepenn jakepenn commented Jun 5, 2026

Copy link
Copy Markdown
Member

Problem

The player webview rendered blurry on low-DPI (non-Retina / 100%) displays when the host scales the editor.

Cause

We carried a fork-local override of viewDidChangeBackingProperties (added in #32, "sync layer contentsScale on backing change") that force-stamped:

[self layer].contentsScale = window.backingScaleFactor;

That override existed only to counter the setWantsLayer:YES first-paint flash hack — which was removed in #34. With the WKWebView back to its default layer-hosting mode, the override is orphaned: stamping the WebKit-owned root layer's contentsScale down to the backing scale clamps WebKit's raster scale and stops it from rendering content (scaled via an ancestor CSS/host transform) at full resolution → blur on 1× displays.

Change

Remove the override entirely, matching JUCE master. WebKit manages contentsScale itself and renders sharply. A short comment is left in place so the override isn't reintroduced.

This is the macOS render path returning to upstream behaviour — none of the other fork customizations (keyboard forwarding, flash/background, DevTools) touch rasterisation.

Testing

Verified the low-DPI blur clears with the override removed (reproduced locally via macOS "Open in Low Resolution", which forces backingScaleFactor = 1).

🤖 Generated with Claude Code

Removes the override that force-stamped layer.contentsScale = backingScaleFactor.
It was added to counter the setWantsLayer:YES first-paint flash hack, which has
since been removed — so on the now layer-hosting WKWebView it was orphaned, and it
clamped WebKit's root-layer raster scale. That left content scaled via an ancestor
CSS/host transform rendering blurry on low-DPI (non-Retina / 100%) displays. Letting
WebKit manage contentsScale (matching JUCE master) renders sharply.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jakepenn jakepenn closed this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant