Updating the theme sometimes fails
Categories
(Toolkit :: Startup and Profile System, defect)
Tracking
()
People
(Reporter: jhirsch, Unassigned)
Details
Seeing this in today's nightly.
Open up about:editprofile, open up the browser toolbox debugger and set a breakpoint at the line where we add the "windowlwthemeupdate" listener, and a breakpoint at the first line of the "windowlwthemeupdate" callback inside SelectableProfileService (or add a console.log line in both spots).
Try changing the theme to a bunch of different themes, including System Theme.
The "windowlwthemeupdate" (or "lightweight-theme-styling-update") events sometimes don't seem to fire when switching between themes. The "windowlwthemeupdate" especially seems to not fire in the case of update the theme from a light theme to the System Theme when the OS is set to light mode.
Idea for a fix #1: could it be the "once" listener for "windowlwthemeupdate" causing some missed events? is "once" removing the listener async and causing some collision if it's repeatedly added and removed?
Idea for a fix #2: for default Profiles themes, avoid relying on events emitted by the addons code. We know which theme the user selected. We could just hard-code the values of themeFg and themeBg in ProfilesParent, and when we get the theme updated message in Profiles:UpdateProfileTheme
, just set themeFg and themeBg to those values. And if we do have to fall back to getting the colors from the window (like what we do in the current "windowlwthemeupdate" callback), maybe we add a timeout when we attach the window listener, so that if we don't get the event within, say, 300 milliseconds (probably longer if Cu.isInAutomation or if we're in a debug build), we cancel the listener and just call the callback directly, so that we figure out themeBg and themeFg and set SelectableProfile.theme.
Reporter | ||
Comment 1•13 days ago
|
||
Hm. This behavior went away after a restart--but I'm not sure why
Reporter | ||
Comment 2•10 days ago
|
||
I haven't been able to reproduce this bug; closing for now as incomplete.
Description
•