:backdrop selector doesn't have any effect when it's applied to #MozillaGtkWidget menubar
Categories
(Core :: Widget: Gtk, defect, P3)
Tracking
()
People
(Reporter: zzag, Unassigned)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0
Steps to reproduce:
Apparently it's not possible to specify text color in the menu bar for inactive Firefox windows, or at least :backdrop selector doesn't have any effect when it's applied to #MozillaWidgetGtk menubar.
Steps to reproduce:
- Put this stylesheet to your GTK theme
#MozillaWidgetGtk menubar,
#MozillaWidgetGtk .menubar {
color: red;
}
#MozillaWidgetGtk menubar:backdrop,
#MozillaWidgetGtk .menubar:backdrop {
color: blue;
}
- Make Firefox inactive
Actual results:
Text in the menubar stays red.
Expected results:
Text in the menubar becomes blue.
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 1•5 years ago
|
||
I use KDE Plasma, but it shouldn't matter because we added support for _NET_WM_STATE_FOCUSED in 5.16.0.
Comment 2•5 years ago
|
||
Yes, it's because we set the backdrop state for titlebar and scrollbars:
I didn't expected anyone want to style menus for instance. Does your style script work for other Gtk3 applications? like gtk3-demo or gtk3-widget-factory.
I expect the construction from nsNativeThemeGTK.cpp:
EventStates docState =
aFrame->GetContent()->OwnerDoc()->GetDocumentState();
aState->backdrop = docState.HasState(NS_DOCUMENT_STATE_WINDOW_INACTIVE);
can be used for all elements. Do you mind to write a patch for it?
Reporter | ||
Comment 3•5 years ago
|
||
(In reply to Martin Stránský [:stransky] from comment #2)
I didn't expected anyone want to style menus for instance.
Depending on the GTK theme, headerbar may have different background color when the client is active or inactive, e.g. black when active, and white when inactive. Thus we need some way to change text color in the menubar when Firefox window becomes inactive to ensure that text is still readable.
Does your style script work for other Gtk3 applications? like gtk3-demo or gtk3-widget-factory.
Yes and no, I'm able to specify background-color for inactive windows, but not color for some reason.
I expect the construction from nsNativeThemeGTK.cpp:
EventStates docState = aFrame->GetContent()->OwnerDoc()->GetDocumentState(); aState->backdrop = docState.HasState(NS_DOCUMENT_STATE_WINDOW_INACTIVE);
can be used for all elements. Do you mind to write a patch for it?
What do you mean?
Reporter | ||
Comment 4•5 years ago
|
||
Comment 5•5 years ago
|
||
(In reply to Vlad Zagorodniy from comment #3)
(In reply to Martin Stránský [:stransky] from comment #2)
I didn't expected anyone want to style menus for instance.
Depending on the GTK theme, headerbar may have different background color
when the client is active or inactive, e.g. black when active, and white
when inactive. Thus we need some way to change text color in the menubar
when Firefox window becomes inactive to ensure that text is still readable.
Yes, I understand.
Does your style script work for other Gtk3 applications? like gtk3-demo or gtk3-widget-factory.
Yes and no, I'm able to specify background-color for inactive windows, but
not color for some reason.
That's interesting. I expect the backdrop should be supported by Gtk themes. Which theme do you tune/write?
I expect the construction from nsNativeThemeGTK.cpp:
EventStates docState = aFrame->GetContent()->OwnerDoc()->GetDocumentState(); aState->backdrop = docState.HasState(NS_DOCUMENT_STATE_WINDOW_INACTIVE);
can be used for all elements. Do you mind to write a patch for it?
What do you mean?
Write a patch to Firefox to fix that. See https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/How_to_Submit_a_Patch for details.
Comment 6•5 years ago
|
||
I see that Gtk+ sets the backdrop for all elements and also redraw menubar when the state changes. I can reproduce that on mate-terminal which draws the menubar.
Reporter | ||
Comment 7•5 years ago
|
||
(In reply to Martin Stránský [:stransky] from comment #5)
That's interesting. I expect the backdrop should be supported by Gtk themes. Which theme do you tune/write?
Breeze, though if I switch to Adwaita, it works.
Write a patch to Firefox to fix that. See https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/How_to_Submit_a_Patch for details.
Sure, I can try. :-)
Reporter | ||
Comment 8•4 years ago
|
||
Hmm, the CSS machinery doesn't actually control the value of text color in the menu bar.
Reporter | ||
Comment 9•4 years ago
|
||
Not sure whether that's a really good idea but perhaps we could expose the backdrop text color of menubar items to chrome stylesheets, e.g. https://paste.ubuntu.com/p/NY5k39P6PS/. It looks a bit hacky but should work. The right thing would be to let the GTK theme set text color, though.
Updated•4 years ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Description
•