sparkle-project / Sparkle

A software update framework for macOS
https://sparkle-project.org
Other
7.28k stars 1.04k forks source link

Fix the WebKit view not transitioning from light to dark mode #2542

Closed zorgiepoo closed 2 months ago

zorgiepoo commented 2 months ago

adaptReleaseNotesAppearance was over-engineered to update the transparent background state of the web view (which was causing the issue) and the background NSBox view when the system changes to dark or light mode. This is partly because when dark mode support was originally written, it used to use a stylesheet that was only specific to dark aqua (and then the code worsened over time to adapt other view changes only to dark mode). This code has since changed some time ago to use a universal stylesheet for both light/dark mode.

So now when the WebKit view is created, we just opt into a transparent background and set up a background NSBox view once and don't do anything when the effectiveAppearance of the views change. This fixes visual issues on current and older OS systems when changing system appearance.

Fixes #2541

Misc Checklist

Testing

I tested and verified my change by using one or multiple of these methods:

Tested modern and legacy WebKit views being initially started in dark or light mode, and switching to other appearance.

macOS version tested: macOS 14.4.1 macOS 12 VM macOS 10.15 VM macOS 10.14 VM

zorgiepoo commented 2 months ago

The scroller's appearance doesn't update immediately upon dark/light switching but that seems like a WebKit bug (FB13745239) which also affects webpages on Safari.