Closed Bug 1954963 Opened 1 year ago Closed 1 year ago

Black or white stripe on mica popups (on dark and light mode respectively) If “AccentColorInactive” is set and “Show accent color on title bars and window borders” is enabled

Categories

(Firefox :: Menus, defect)

Firefox 138
Desktop
Windows 11
defect

Tracking

()

VERIFIED FIXED
138 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox136 --- unaffected
firefox137 --- unaffected
firefox138 + verified
firefox139 --- verified

People

(Reporter: alice0775, Assigned: emilio)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: nightly-community, regression)

Attachments

(2 files, 1 external file)

Attached image screenshot —

Steps to reproduce:

  1. OS theme dark
  2. Open menu Alt > h OR right mouse click on contentarea

Actual results:
The background-color of menupopup in the menu bar is wrong.
Border-color is low contrast than Firefox137.0b7.

Expected results:
Should be same color

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=d94bb6e69a16d45c8308abb62c063118d1232c49&tochange=025a26c34be0266ae84b2c61c76a6f752916e15b

:emilio, since you are the author of the regressor, bug 1953636, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)
Summary: The background-color of menupopup in the menu bar is wrong. → The background-color of menupopup in the menu bar and contentAreaContextMenu is wrong.

And contextmenu of bookmarks and toolbar/toolbutton is also affected.

So to be clear the change in colors is expected.

The border color is provided by windows just like the shadow. That black stripe looks like a bug tho. Are you seeing that consistently, only sometimes, or...?

Flags: needinfo?(emilio) → needinfo?(alice0775)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

So to be clear the change in colors is expected.

The border color is provided by windows just like the shadow. That black stripe looks like a bug tho. Are you seeing that consistently, only sometimes, or...?

It's consistently the same every time.

Flags: needinfo?(alice0775)

Do other menus like the regular website context menu or what not hit the same issue?

Flags: needinfo?(alice0775)

Some follow-up questions:

  • What Windows version are you on?
  • If you go to settings > Accessibility > Visual effects, what values do the settings have? In particular "Transparency effects" is interesting.
  • If the black stripe happens only on the menubar, do you have the menubar enabled unconditionally or disabled?
  • Any other interesting setting or so that might affect it on windows?
  • about:support might also be interesting (graphics config in particular). Does gfx.webrender.software=true or somesuch fix this?

Also, if you enable widget.windows.mica, does it show the same black stripe? What about if you move the main window around?

(In reply to Emilio Cobos Álvarez (:emilio) from comment #5)

Do other menus like the regular website context menu or what not hit the same issue?

Yes.
Not only dark theme but also light theme.

Affected:
context menu of contents area
menupopup from menu bar of main window as well as library window
context menu of toolbar and tabbar as well as tab
Context menu of bookmarks and history from anywhere
context menu of sidebar
context menu of addressbar, search bar

Unaffected:
Hamburger menu
List All Tabs menu
menupoup up from bookmarks toolbar

Flags: needinfo?(alice0775)

To be clear, "the same issue" is the black stripe, right? Not the different color

But thanks. I can't repro this, so I wonder what is different between our setups.

If you could, could you go to about:logging, set the windows preset, and reproduce the issue, then share the profile?

(In reply to Emilio Cobos Álvarez (:emilio) from comment #7)

Also, if you enable widget.windows.mica, does it show the same black stripe?

Yes, this issue appears.

What about if you move the main window around?

It appears regardless of window position.
And It appears regardless of titlebar/menubar is enabled/disabled. It appears regardless OS Transparent/Animation settings.

(In reply to Emilio Cobos Álvarez (:emilio) from comment #11)

If you could, could you go to about:logging, set the windows preset, and reproduce the issue, then share the profile?

about:logging
https://share.firefox.dev/4idZNW0

P.S. It doesn't seem to be reflected in the profiler screenshot for some reason.

Attached file about:support —

(In reply to Emilio Cobos Álvarez (:emilio) from comment #6)

Some follow-up questions:

  • What Windows version are you on?

Windows 11 Home 24H2
OS build: 26100.3476
Experience: 1000.26100.54.0

  • If you go to settings > Accessibility > Visual effects, what values do the settings have? In particular "Transparency effects" is interesting.

The bug appears regardless of the setting.

  • If the black stripe happens only on the menubar, do you have the menubar enabled unconditionally or disabled?

It seems all menupopup. Execpt Hamburger panel, menupopup of bookmarks toolbar.

  • Any other interesting setting or so that might affect it on windows?
  • about:support might also be interesting (graphics config in particular). Does gfx.webrender.software=true or somesuch fix this?

Disabled HWA does not help.
gfx.webrender.software=true also do not help.

The bug was reproduced on Windows Safe Mode.

Thanks Alice!

Rewording the title for the actual bug here (the color change is intended, the stripe isn't).

[Tracking Requested - why for this release]: We don't know what kind of set ups are affected by this vs. not, we should at least figure that out before shipping this to release.

Summary: The background-color of menupopup in the menu bar and contentAreaContextMenu is wrong. → Black stripe on mica popups
Blocks: windows-mica

Yeah, I don't know which setting in Windows is causing the problem.

The problem appears when a transparent color is set for the background color.
The workaround is to set a non-transparent color as follows.

menupopup {
  background-color: var(--toolbar-bgcolor) !mportant;
}

Yeah that makes sense, that background is drawn by windows, so we need to have a semi-transparent background for it to be shown.

As a workaround, you can turn widget.windows.mica.popups off which basically goes back to the previous behavior. Another question, does the same thing happen in light mode? What color is the stripe? Black as well?

Flags: needinfo?(alice0775)
Flags: needinfo?(emilio)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #9)

To be clear, "the same issue" is the black stripe, right? Not the different color

Sorry, the color is different.
Dark theme: black stripe
Light theme: white stripe

Flags: needinfo?(alice0775)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #18)

Yeah that makes sense, that background is drawn by windows, so we need to have a semi-transparent background for it to be shown.

As a workaround, you can turn widget.windows.mica.popups off which basically goes back to the previous behavior.

Yes, flipping the widget.windows.mica.popups will fix this problem.

Another question, does the same thing happen in light mode? What color is the stripe? Black as well?

Please see comment#19.

Can't repro in safe mode either, will try on a laptop with a separate windows build... :(

Summary: Black stripe on mica popups → Black or white stripe on mica popups (on dark and light mode respectively)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #21)

Can't repro in safe mode either, will try on a laptop with a separate windows build... :(

I could not reproduce this problem with a new Windows user account on the same PC...

Thanks, so I guess that means there's something in the registry that causes that?

I wonder what that would be tho...

If you don't mind (there might be sensitive information, though I'll do my best to keep it for as little as possible and delete right away), mind exporting the HKEY_CURRENT_USER registry branch using this guide, and mailing it to me?

Ideally of both users (the bad and the good) but I could try to figure out with just the broken one.

Otherwise, tomorrow I'll try to somehow poke at different things that might affect this... My best guess right now is some registry configuration causing DWM to draw titlebars (but what, why?)

Flags: needinfo?(alice0775)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #24)

If you don't mind (there might be sensitive information, though I'll do my best to keep it for as little as possible and delete right away), mind exporting the HKEY_CURRENT_USER registry branch using this guide, and mailing it to me?

Ideally of both users (the bad and the good) but I could try to figure out with just the broken one.

Otherwise, tomorrow I'll try to somehow poke at different things that might affect this... My best guess right now is some registry configuration causing DWM to draw titlebars (but what, why?)

Okay, I attached diff as follows.

HKEY_CURRENT_USER.reg : BAD reg
HKEY_CURRENT_USER0.reg : GOOD reg

--- HKEY_CURRENT_USER.reg	2025-03-20 05:50:23.588504700 +0900
+++ HKEY_CURRENT_USER0.reg	2025-03-20 05:50:01.475180000 +0900
 [HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics]
+"IconTitleWrap"="1"
 "Shell Icon Size"="32"
-"BorderWidth"="-15"
-"CaptionFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,\
+"BorderWidth"="-12"
+"CaptionFont"=hex:f1,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,\
   00,00,00,01,00,00,05,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,\
   00,20,00,55,00,49,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
   00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
-"CaptionHeight"="-300"
-"CaptionWidth"="-555"
-"IconFont"=hex:f2,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,\
-  00,00,80,00,00,00,31,4d,00,69,00,67,00,75,00,20,00,31,00,4d,00,00,00,00,00,\
-  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
+"CaptionHeight"="-336"
+"CaptionWidth"="-336"
+"IconFont"=hex:f1,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,\
+  00,00,01,00,00,05,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,\
+  20,00,55,00,49,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
   00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
-"IconTitleWrap"="1"
-"MenuFont"=hex:f2,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,\
-  00,00,80,00,00,00,32,4d,00,65,00,69,00,72,00,79,00,6f,00,4b,00,65,00,5f,00,\
-  55,00,49,00,47,00,6f,00,74,00,68,00,69,00,63,00,00,00,00,00,00,00,00,00,00,\
+"MenuFont"=hex:f1,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,\
+  00,00,01,00,00,05,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,00,\
+  20,00,55,00,49,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
   00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
-"MenuHeight"="-285"
-"MenuWidth"="-285"
-"MessageFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,\
-  00,00,00,80,00,00,00,32,4d,00,65,00,69,00,72,00,79,00,6f,00,4b,00,65,00,5f,\
-  00,55,00,49,00,47,00,6f,00,74,00,68,00,69,00,63,00,00,00,00,00,00,00,00,00,\
+"MenuHeight"="-288"
+"MenuWidth"="-288"
+"MessageFont"=hex:f1,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,\
+  00,00,00,01,00,00,05,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,\
+  00,20,00,55,00,49,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
   00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
-"ScrollHeight"="-255"
-"ScrollWidth"="-255"
-"SmCaptionFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,\
-  00,00,00,00,80,00,00,00,32,4d,00,65,00,69,00,72,00,79,00,6f,00,4b,00,65,00,\
-  5f,00,55,00,49,00,47,00,6f,00,74,00,68,00,69,00,63,00,00,00,00,00,00,00,00,\
+"ScrollHeight"="-252"
+"ScrollWidth"="-252"
+"SmCaptionFont"=hex:f1,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,\
+  00,00,00,00,01,00,00,05,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,00,\
+  63,00,20,00,55,00,49,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
   00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
-"SmCaptionHeight"="-330"
-"SmCaptionWidth"="-330"
-"StatusFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,\
-  00,00,00,80,00,00,00,32,4d,00,65,00,69,00,72,00,79,00,6f,00,4b,00,65,00,5f,\
-  00,55,00,49,00,47,00,6f,00,74,00,68,00,69,00,63,00,00,00,00,00,00,00,00,00,\
+"SmCaptionHeight"="-336"
+"SmCaptionWidth"="-336"
+"StatusFont"=hex:f1,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,\
+  00,00,00,01,00,00,05,00,59,00,75,00,20,00,47,00,6f,00,74,00,68,00,69,00,63,\
+  00,20,00,55,00,49,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
   00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
 "PaddedBorderWidth"="-60"
-"AppliedDPI"=dword:00000060
+"AppliedDPI"=dword:00000078
 "IconSpacing"="-1500"
 "MinAnimate"="0"
 

And I replaced all number values except "*Font" with GOOD reg values and restarted Windows. Then, the problem disappeared completely.

Flags: needinfo?(alice0775)

Hmmm, however, Windows > Settings > Personalization > Color > Show accent color on title bars and window borders
The problem appears if enabled Show accent color on title bars and window borders....

Thanks, interesting. So... that is HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\DWM... Is that registry folder different between the two accounts there?

Also, is there any software installed that might interfere with DWM somehow?

Also, does the issue go away if you turn that option off again?

Finally, I delete the following registry. The problem is gone even if turn on the Show accent color on title bars and window borders.

[HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM]
"AccentColorInactive"=dword:ff9f9f9f
Summary: Black or white stripe on mica popups (on dark and light mode respectively) → Black or white stripe on mica popups (on dark and light mode respectively) If “AccentColorInactive” is set and “Show accent color on title bars and window borders” is enabled

Thanks! Do you know how that option ended up there?

(In reply to Emilio Cobos Álvarez (:emilio) from comment #27)

Thanks, interesting. So... that is HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\DWM... Is that registry folder different between the two accounts there?

yes. I found a culprit from diff between Good and Bad registry. AccentColorInactive” was in the bad registry.

Also, is there any software installed that might interfere with DWM somehow?

It's WinaeroTweaker (Appearance > Inactive Title Bars Color).

See comments (both in the code and the bug) and feedback hub link.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

I could reproduce comment 31. I filed a feedback hub, and tried some things without success to try to nag DWM into not drawing the titlebar... But failed, so workaround it is for now.

Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c6afd82b11f0 Disable mica popups in some cases to work around a DWM bug. r=win-reviewers,handyman
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3e72832af469 Fix test_chrome_only_media_queries to account for mica popups pref not being a bool anymore.
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
Flags: qe-verify+

I am not able to reproduce the issue on Win11x64 using Firefox build 138.0a1(20250318213234) and 138.0a1(20250317212230) I tried on multiple themes both light and dark but I am not able to reproduce the issue in order to confirm the fix.
Alice can you pleas confirm it on your environment? Thank you.

Flags: needinfo?(alice0775)

I managed to reproduce the issue on Nightly138.0a1(20250319094349).
And I have verified that the issue has been fixed in Nightly 139.0a1(20250409210623) and 138.0b4(20250407102644).

Flags: needinfo?(alice0775)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: