Closed Bug 1870100 Opened 9 months ago Closed 9 months ago

[Linux] Menubar and tab-title text changes to inactive/active color when Firefox window loses/gains focus, potentially after substantial jank/delay

Categories

(Firefox :: Theme, defect)

defect

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: dholbert, Assigned: emilio)

References

Details

Attachments

(3 files)

As of bug 1869299 (pushlog https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=34533b3add99fe26cbd60a7fd8d0c60966e5fd32&tochange=89da90df398f5aee595e14748b0241ede2a9fd4d ), the Firefox tab-title text and menu bar text changes to be an inactive-looking gray color when you move Firefox windows to the background; and then the text changes to be dark again when the window moves to the foreground.

In my main browsing profile, this repaint is delayed by about 1 second when I switch between Firefox windows. The jank itself seems to be bug 1849393 -- a performance-profile shows me spending ~736ms in SessionWriter.sys.mjs write when I switch windows -- but previously that delay wasn't as visually-noticeable. Now that we're queuing up a more-noticeable repaint on window-switch, it makes this jank a bit more of a visual problem.

(Previously, we just changed the tint of some background colors when foregrounding/backgrounding a window, but the window didn't look quite as obviously "wrong" during a period of jank. Now that we have grayed-out text, it looks quite wrong during the jank period when the window is clearly in the foreground and yet using inactive text.)

Here's a profile (URLs redacted) in my main browsing profile showing a window-switch operation:
https://share.firefox.dev/48fwgpt

Not quite sure how best to track this; this is sort of a dupe/manifestation of bug 1849393, but the visibility of the issue has been increased due to this theme change, to my eye at least.

Emilio, any idea here?
Thanks.

Flags: needinfo?(emilio)

Here's a screencast showing how this looks, with me alt-tabbing back and forth between my main Firefox window (many tabs open, tabstrip not shown here for privacy) and a new window. You can see there's a ~1s delay between the new window being foregrounded and the text losing its "inactive" grayed-out look.

Here's another profile that I took while doing a few additional alt-tab operations like the ones shown in the screencast:
https://share.firefox.dev/3v1U3eg

This shows that this isn't just bug 1849393; we're also doing some extremely-long (300-400ms) restyle operations. Possibly because my main browsing window has several hundred tabs open and they all get their tab title-text restyled when the window gets foregrounded/backgrounded. I'm not sure if that part may have gotten more expensive as a result of bug 1849393 (due to the text color change), or if it's just more noticeable now.

Hmm, if my browser-toolbox's view of my tabstrip is to be trusted, I may have ~3900 tabs open in my main Firefox Window. So that may make my experience a bit edge-casey and might partially explain why the tabstrip-restyle is so expensive.

Flags: needinfo?(emilio)

Gonna move this to Session Restore. It really shouldn't block the next paint when switching windows.

Component: Widget: Gtk → Session Restore
Product: Core → Firefox

Dao, I have a theming side fix for this slow restyle regression, but Phabricator is stuck: https://phabricator.services.mozilla.com/D196543

I'll file a separate one for the session restore.

Component: Session Restore → Theme
Assignee: nobody → emilio
See Also: → 1870245
No longer depends on: 1849393

This avoids big restyles when users have a massive number of tabs. A
color change inherits, so we need to propagate the color change to the
whole subtree, which with a lot of tabs can be huge (66k elements in the
profile in the bug).

Instead, don't change the text color on inactive windows, and fade the
titlebar entirely using opacity, which is a one-element change.

(In reply to Dão Gottwald [:dao] from comment #5)

Gonna move this to Session Restore. It really shouldn't block the next paint when switching windows.

For reference, Emilio spun this part off as bug 1870245.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ab5e2f241728
Move browser toolbar colors to browser-shared.css. r=dao,desktop-theme-reviewers
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/80d2ca5e4bec
Fade the titlebar entirely rather than by changing text color. r=dao,desktop-theme-reviewers
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 9 months ago9 months ago
Resolution: --- → FIXED
Blocks: 1870803
Regressions: 1871375
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: