sbarex / SourceCodeSyntaxHighlight

Quick Look extension for highlight source code files on macOS 10.15 and later.
GNU General Public License v3.0
3.02k stars 72 forks source link

Dark mode detection sometimes unreliable in auto mode #164

Open i0ntempest opened 2 years ago

i0ntempest commented 2 years ago

I've noticed this for a pretty long time, sometimes the quicklook window shows the dark appearance even when the system appearance is light (in auto mode). Manually switching to either light or dark mode will temporarily fix the issue, but may reoccur after another automated appearance change. EDIT: More specifically, I think it happens if I shutdown the system at night and start it up again in the morning. Then the appearance would not follow the system. Screen Shot 2022-04-19 at 13 04 27

sbarex commented 2 years ago

When does the problem occur?

or

in the first case it is a known problem that would take too much work to solve. Just close the preview, wait a bit for the cache to clear (or request a preview of another file), and reopen the preview to view the correct style.

In the second case, if the file was recently previewed, the previous style view may still be in the cache.

i0ntempest commented 2 years ago

It's neither of those. I think it happens if I shutdown the system at night (dark appearance) and start it up again in the morning (light appearance). Resetting quicklookd and quicklook cache does not help, newly generated previews are still using the wrong appearance. If system appearance changes (say by manually changing the time zone), it will start using the correct appearance.

sbarex commented 2 years ago

What version of macOS do you use?

i0ntempest commented 2 years ago

Newest release 12.3.1

sbarex commented 2 years ago

Try the release 2.1.12 (61).

i0ntempest commented 2 years ago

Tried for a few days, looks like the problem was fixed. Thanks!

i0ntempest commented 2 years ago

Hey, I noticed a few times of this reoccurring, though the nature of the problem changed a bit. Sometimes it just stucks in the wrong appearance, with a reboot being the only way to fix it. Resetting quicklookd and quicklook cache does not help just like before but what's new is manually changing system appearance does not work either now. Maybe a relogin will also fix it but I haven't tried, and it definitely occurs less frequent than before.