Open Bug 1993873 Opened 1 year ago Updated 11 months ago

[Ubuntu 16.04] Tooltips, which appear when tool icons are touched, have white color font and have transparent color background - which is together unreadable.

Categories

(Core :: Widget: Gtk, defect, P5)

Firefox 143
defect

Tracking

()

UNCONFIRMED

People

(Reporter: exception.true, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:143.0) Gecko/20100101 Firefox/143.0

Steps to reproduce:

Firefox 143.0.4 32-bit Linux on Ubuntu 16.04

Tooltips, which appear when tool icons are touched, have white color font and have transparent color background.

Actual results:

... which is together unreadable tooltip.

I have tried to switch off hardware acceleration and restart FF, but it didn't solved bug.

Expected results:

Background should be grey, since font is currently white. Or dark font and white background.

Sorry, it is not easy to make print screen for this bug.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

I have also tried to:

  • change theme to dark, then
  • download external theme, and
  • set contrast auto, off or other.
    Bug persist.

Additionally unreadable:
Transparent background have tooltips for the toolbar, and also tool tips in the pages, which is unreadable.
Tooltips for buttons like "List all tabs" or "Minimize and close window" have also transparent background and white font, which is unreadable.

Proper:
Main menu and context menu have dark gray color and white font, which is readable and proper.
Tooltips for Tabs have white background and dark font, which is readable and proper.
Interesting, in firefox preferences page, tooltips for main menu at the left side are white background and dark font, which is proper.

So summarized, transparent bg and white font are tooltips for:

  • toolbar and all tools,
  • bookmarks bar and all bookmarks,
  • buttons on some pages (like this one Bugzilla), but not all pages (like firefox about:preferences main page),
  • main firefox window buttons (window minimize (-), maximize (square), close (x),
  • list all tabs button (arrow down at top left)).

Adding detail to "but not all pages (like firefox about:preferences main page),":

On preferences page tooltips for main menu on left side are ok (white bg and dark font). But tooltips for choices on right side of the preferences page, like buttons for theme choice, have also unreadable tooltips (transparent bg and white font).

Can you attach a screenshot of it and also your about:support page?
Thanks.

Flags: needinfo?(exception.true)
Flags: needinfo?(exception.true)

Sad thing: I am not succeeding with screenshot. I tried my best with:

echo -n "">/tmp/s.png; import -pause 10  -window $(xdotool search -name tooltips)  tif:- | convert -compress Lossless tif:- /tmp/s.png

Code made a nice screenshot, but buggy tooltip is simply not visible in any way tested.

Sending you about:settings in json format.

Note: FF is installed in user way. Not via root and sudo. Maybe some system settings are not inhereted properly via user way of installation.

I got some light. I have installed few extensions, and this is possible source of bug. In a while I could try with another fresh install and I can report difference.

Tested fresh install - bug remain. Source of tooltip bug are not later added extensions or any settings change from the user, since bug exist in fresh install of ff 143.0.4.

Attached image IMAG0397.jpg —

Here is a bumpy screenshot.
We see two bugs in one shot:

  • Bug1: Mouse is at Sidebar button, and tooltip deriving from sidebar button is transparent.
  • Bug2: Main window frame is separated from main window. Background in between is transparent.

Bug2 may disappear sometimes, it is seen when window is normal (not maximized, like on the picture). When window is maximized it is not seen, and then appear again if window is normal. Bug2 does not appear immediately after ff restart, but later.

Bug1 remain for now, and is constant, it doesn't change during session.

I saw in about:settings, the bugs are maybe connected to GL section, which is all marked as "Added to reject list; error code: FEATURE_FAILURE_OPENGL" ("Dodano na seznam zavrnjenih; koda napake: ...").

These two bugs are the only one found in ff 143.0.4. Where Bug1 is spread to more buttons and tools, as said in previous posts.

Thanks for the screenshots. I'm not sure its feasible to fix that as Ubuntu 16.04 EOL'ed on April 30, 2021.
Emilio, is there any quick fix or fallback we can provide?
Thanks.

Flags: needinfo?(emilio)
Priority: -- → P5
Summary: Tooltips, which appear when tool icons are touched, have white color font and have transparent color background - which is together unreadable. → [Ubuntu 16.04] Tooltips, which appear when tool icons are touched, have white color font and have transparent color background - which is together unreadable.

Not so much about ubuntu but about this specific GTK Theme (Ambiant MATE). But that theme seems also discontinued. We could somehow detect transparent background here and mint something, but yeah relatively low priority.

Flags: needinfo?(emilio)

Since priority on this subject is mentioned, I have take a look into, based on code you provided. I am not common to C and GTK, but had some minutes to spend.

Tooltip at line 2217 has no handler for transparent background.
Menupopup at line 2368 has such transparency handler.

Please verify, if Menupopups transparency handler could be implemented to Tooltips:

void nsLookAndFeel::PerThemeData::Init() {
  // tooltip foreground and background
  style = GtkWidgets::GetStyle(GtkWidgets::Type::TooltipBoxLabel);
  mInfo.mFg = GetTextColor(style);
  style = GtkWidgets::GetStyle(GtkWidgets::Type::Tooltip);

  // Set the background color with a lambda to handle transparency
  mInfo.mBg = [&] {
      nscolor color = GetBackgroundColor(style, mInfo.mFg);
      if (NS_GET_A(color)) {
          // If the color has an alpha value greater than 0 
          //   meaning it's not fully transparent), return that color.
          return color;
      }
      
      // Attempt to get the backdrop color if the initial color is transparent:
      // If the initial attempt fails (returns fully transparent), 
      //   try to fetch the background color again, 
      //   this time considering the GTK_STATE_FLAG_BACKDROP, 
      //   which is relevant for themes that apply styles for backdrop states.
      color = GetBackgroundColor(style, mInfo.mFg, GTK_STATE_FLAG_BACKDROP);
      if (NS_GET_A(color)) {
          return color; // Return the backdrop color if it's not transparent
      }

      // If all attempts to determine a suitable background color fail,
      //   log a warning and fallback to a default color (like window background).
      NS_WARNING(
          "Couldn't find tooltip background color, falling back to window "
          "background");
      return mWindow.mBg; // Replace with appropriate fallback
  }();

  mTooltipRadius = GetBorderRadius(style);
}

The code above is not tested in real, it is only verified by bot:
"
Code1 is Menupopup code, Code2 is Tooltip code:

  • You're correct in suggesting that the approach used in Code1 for handling the background color of the menu popup is a more robust and flexible way to manage the tooltip background color issue in Code2. Instead of falling back to a fixed color, we can apply a similar logic to ensure that we avoid transparent backgrounds for tooltips as well.
  • This approach allows the tooltip background color to adapt dynamically based on the theme and the foreground color rather than relying on a fixed background.
  • This way, you can effectively eliminate the transparent background bug for tooltips while keeping the code clean and maintainable.
    "
Severity: -- → S4
Severity: S4 → S3

thanks for reporting this. i have exactly the same problem. it appeared with firefox 142.0.

it seems that with the more recent versions, the problem appears in less places. previously, tooltips on webpages (for title attributes for example) where white with no background, which was the most problematic as it made them completely unreadable on pages with a white background. now, these tooltips display fine (white text on a (very) dark grey background, no frame).

tooltips of tabs seem to have their own style: white text on a less dark grey background, on multiple lines and with rounded corners. these display fine.

tooltips of toolbar elements are almost all affected by the bug (white text, no background, white frame). there are a few exceptions to this: the back, forward and reload button are not affected, but the home button is. the shield icon is not affected (correct tooltip), but the padlock button is. all the other buttons are (even the hamburger menu).

I've checked 'hugues de keyzer' report on my updated FF to v144.0 and I can't report the same behavior as hugues de keyzer. All tooltips are still 'White text, no background, white frame.' Except main menu (left click), menupopups (right click), and also tab tooltips - which are ok. There was no improvement seen yet from v143 to v144.

i don’t know whether this was due to more recent versions, but the behavior on my side is still as i reported. i noticed that some other toolbar buttons are not affected by the bug for me: the toggle reader view and the downloads buttons are also not affected.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: