Toggling "Show accent color on title bar" in Windows settings is not picked up until restart

REOPENED
Assigned to

Status

()

Core
Widget: Win32
P1
normal
REOPENED
a month ago
6 hours ago

People

(Reporter: johannh, Assigned: jwatt, NeedInfo)

Tracking

unspecified
mozilla56
Points:
---
Bug Flags:
qe-verify +

Firefox Tracking Flags

(firefox56 fixed, firefox57 fixed)

Details

(Whiteboard: [reserve-photon-visual])

Attachments

(2 attachments)

(Reporter)

Description

a month ago
When I check the "Show color in title bar" checkbox in Windows accent color settings I would expect Firefox to instantly change to the Windows accent color (like the settings screen does). It doesn't.
(Reporter)

Comment 1

a month ago
Jonathan, can we enable this somehow?
Component: Theme → Widget: Win32
Flags: needinfo?(jwatt)
Product: Firefox → Core
Comment hidden (offtopic)
Comment hidden (offtopic)
(Assignee)

Comment 4

a month ago
Created attachment 8884696 [details] [diff] [review]
patch

The '-moz-win-accentcolor' keyword is already live to changes to the color that is chosen for the Windows 10 accent color. This patch is required to invalidate the cached result of the '-moz-windows-accent-color-applies' media query when the Windows 10 accent color is enabled/disabled in the Windows settings.
Assignee: nobody → jwatt
Status: NEW → ASSIGNED
Flags: needinfo?(jwatt)
Attachment #8884696 - Flags: review?(dholbert)

Updated

a month ago
Flags: qe-verify?
Priority: -- → P1
Whiteboard: [photon-visual][triage] → [photon-visual]
Attachment #8884696 - Flags: review?(dholbert) → review+

Comment 5

a month ago
Pushed by dgottwald@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/33f7f73ffb36
Make the '-moz-windows-accent-color-applies' media query live to Windows 10 settings changes. r=dholbert

Comment 6

a month ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/33f7f73ffb36
Status: ASSIGNED → RESOLVED
Last Resolved: a month ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56

Updated

a month ago
Iteration: --- → 56.3 - Jul 24

Updated

a month ago
Flags: qe-verify? → qe-verify+
QA Contact: brindusa.tot
This doesn't seem to be working for me. In a current (7/20) Nightly, when I enable the Win10 option to show the titlebar accent color, I still have to restart Firefox for it to take effect (otherwise it continues to just show the default Firefox theme). Ditto for disabling the Windows setting (Firefox continues to use the accent color until it is restarted).

The color itself will update w/o a restart when I change it from the Windows dialog.
Status: RESOLVED → REOPENED
Flags: needinfo?(dholbert)
Resolution: FIXED → ---
[I think you meant to needinfo the patch-author, jwatt, who conveniently is back as of today according to his Bugzilla nick.  Transferring ni.]
Flags: needinfo?(dholbert) → needinfo?(jwatt)
(Reporter)

Comment 9

24 days ago
After using this on Windows for a few days it seems like certain actions e.g. minimizing the browser window or opening a new window will cause the setting to apply correctly. We probably need to do out whatever these actions are doing to reset/invalidate the accent color.
(Reporter)

Comment 10

24 days ago
> need to do out

Sigh, this was originally "find out" but I'm trying to say "we need to do whatever these actions are doing".
(Assignee)

Comment 11

23 days ago
Strange. This works for certain windows such as the Browser Console. I'm pretty sure I was just using regular windows when I tested this though.
Flags: needinfo?(jwatt)
(Assignee)

Comment 12

23 days ago
(In reply to Johann Hofmann [:johannh] from comment #9)
> After using this on Windows for a few days it seems like certain actions
> e.g. minimizing the browser window or opening a new window will cause the
> setting to apply correctly.

When resizing the window etc. causes the visual appearance to correctly refresh we end up getting the media query value under the stack:

  GetSystemMetric
  nsMediaQueryResultCacheKey::Matches
  nsCSSRuleProcessor::RefreshRuleCascade
  nsCSSRuleProcessor::MediumFeaturesChanged
  nsStyleSet::MediumFeaturesChanged
  mozilla::StyleSetHandle::Ptr::MediumFeaturesChanged
  nsPresContext::MediaFeatureValuesChanged
  nsPresContext::FlushPendingMediaFeatureValuesChanged
  mozilla::PresShell::DoFlushPendingNotifications
  nsIPresShell::FlushPendingNotifications
  mozilla::PresShell::DoFlushPendingNotifications
  nsIPresShell::FlushPendingNotifications
  nsDocument::FlushPendingNotifications
  mozilla::dom::BoxObject::GetPresShell
  mozilla::dom::BoxObject::GetFrame
  mozilla::dom::BoxObject::GetOffsetRect
  mozilla::dom::BoxObject::GetWidth
  mozilla::dom::BoxObject::Width
  mozilla::dom::BoxObjectBinding::get_width

It looks like the patch I needed really should be calling nsPresContext::MediaFeatureValuesChanged too.
(Assignee)

Comment 13

23 days ago
Created attachment 8890350 [details] [diff] [review]
part 2 - Invalidate and notify when clearing cached media features for Windows accent c olor changes
Attachment #8890350 - Flags: review?(dholbert)
Comment on attachment 8890350 [details] [diff] [review]
part 2 - Invalidate and notify when clearing cached media features for Windows accent c olor changes

Review of attachment 8890350 [details] [diff] [review]:
-----------------------------------------------------------------

r=me
Attachment #8890350 - Flags: review?(dholbert) → review+

Comment 15

16 days ago
Pushed by jwatt@jwatt.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6db4b0af686c
part 2 - Invalidate and notify when clearing cached media features for Windows accent color changes. r=dholbert

Updated

16 days ago
Iteration: 56.3 - Jul 24 → ---

Comment 16

15 days ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/6db4b0af686c
Status: REOPENED → RESOLVED
Last Resolved: a month ago15 days ago
status-firefox57: --- → fixed
Resolution: --- → FIXED

Updated

15 days ago
Iteration: --- → 57.1 - Aug 15
QA Contact: brindusa.tot → ovidiu.boca

Comment 17

16 hours ago
I tested this on Windows 10 with FF Nightly 57.0a1(2017-08-16) and I still can reproduce this issue.
Status: RESOLVED → REOPENED
Flags: needinfo?(jwatt)
Resolution: FIXED → ---

Updated

16 hours ago
Iteration: 57.1 - Aug 15 → ---
Whiteboard: [photon-visual] → [reserve-photon-visual]
(Assignee)

Comment 18

6 hours ago
As best I can tell we have some sort of race when there are multiple top level windows. Sometimes it works, sometimes it doesn't. Annoyingly it usually works when Firefox is run from a debugger with breakpoints set.

Ovidiu, did you notice any particular pattern of interaction that would cause it to work or not work?
Flags: needinfo?(jwatt) → needinfo?(ovidiu.boca)
You need to log in before you can comment on or make changes to this bug.