Closed Bug 1964046 Opened 4 months ago Closed 3 months ago

After bug 1964022, titlebar buttons with adwaita look a bit off.

Categories

(Core :: Widget: Gtk, defect)

defect

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

(Blocks 2 open bugs)

Details

Attachments

(5 files)

Since they still use the old GTK3 buttons.

I think the ideal thing to do would be to render the buttons on our own, but using the right icon theme and foreground color. That would even allow us to get rid of the "non-native" titlebar buttons too.

What we want is really using the window-{maximize,minimize,restore,close}-symbolic icons. moz-icon:// exposes them but only with 1x resolution. I hacked nsIconChannel to allow sending icons with 2x scale (so that they look crisp on HiDPI), but even with that there's another issue, which is that those icons should change with the color scheme of the window (kinda like context-properties).

So for the scale I can hack around it, either by hardcoding a bigger scale, or passing it in the query string and using image-set() in the front-end. But I'm guessing the foreground color bit is not that easy to hack around (at least I haven't found an easy way).

I'm assuming that if I were to make that work, I'd need some new vector-like image type (so that we can decode-per-color or so)? Or can you think of another way of making something like that work?

Flags: needinfo?(tnikkel)

This doesn't quite work because on color scheme changes they stay
frozen.

^ is what I was trying fwiw.

Assignee: nobody → emilio
Attachment #9485029 - Attachment description: WIP: Bug 1964046 - Improve titlebar icons on Linux. → Bug 1964046 - Add support for scale and color-scheme to moz-icon:// URIs on GTK. r=stransky!
Status: NEW → ASSIGNED

Using this for the action icon and such is harder.

This looks better on the native theme, and on the built-in themes too.

It's a mixed improvement and regression for non-native themes:

  • On one hand, we use the system icons.
  • On the other, we don't use the theme fill (which usually would be
    used via context-fill / context-stroke).

So over-all I think it's worth it.

As we don't really need them. This avoids non-webrender drawing on the
main window altogether.

Attachment #9486577 - Attachment description: Bug 1964046 - Avoid falling cairo draw path for window decorations on wayland. r=stransky → Bug 1964046 - Avoid falling back to cairo for window decorations on wayland. r=stransky

Nice to see the icon decoder gets updated, very much needed. I see that detecting text direction from file endings (ltr/rtl) is gone. Maybe it's just old school scheme and not needed anymore? And this is more of a feature request, would it not be possible to get rid of gtkiconsize as it's completely different in gtk4? If it's hardcoded upstreams in gtk3 you might as well hardcode it yourself? And get rid of gtk_icon_size_lookup in the process. But this is a huge rework that gets rid of basically everything that is already deprecated in gtk3, good work!!

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/eee332f4853b Add support for scale and color-scheme to moz-icon:// URIs on GTK. r=stransky
Keywords: leave-open
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5c3a64943da8 Remove unused native titlebar drawing code. r=stransky
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/025d3cf31593 Avoid falling back to cairo for window decorations on wayland. r=stransky
Blocks: 1965779

(In reply to Jens Persson from comment #8)

Nice to see the icon decoder gets updated, very much needed. I see that detecting text direction from file endings (ltr/rtl) is gone. Maybe it's just old school scheme and not needed anymore?

Yeah we don't use any icon names ending in ltr/rtl afaict.

And this is more of a feature request, would it not be possible to get rid of gtkiconsize as it's completely different in gtk4? If it's hardcoded upstreams in gtk3 you might as well hardcode it yourself? And get rid of gtk_icon_size_lookup in the process. But this is a huge rework that gets rid of basically everything that is already deprecated in gtk3, good work!!

Let's do that in bug 1965779.

Keywords: leave-open
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/db25c2152ea0 Use HiDPI symbolic icons for the titlebar. r=stransky,desktop-theme-reviewers,dao
Blocks: 1966344
Blocks: 1966345
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d122340fa854 Use HiDPI icons in preferences app list. r=settings-reviewers,Gijs
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
See Also: → 1966649
Flags: needinfo?(tnikkel)
Regressions: 1966890
Blocks: 1885848
QA Whiteboard: [qa-triage-done-c141/b140]
Regressions: 1969850
Regressions: 1968920
No longer regressions: 1969850
Regressions: 1967099
See Also: → 1979338
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: