Title bar's corners are straight in a folded HdyLeaflet
This is not a bug of libhandy per se but we are the only one affected by this and it would prevent other from using the leaflet widget, so we need to fix it. This bug entry is there to gather knowledge.
Conversation with the GTK devs:
Adrien Plazas: In libhandy we have this bug which makes widgets contained in a leaflet itself contained in a header bar to not draw their corners rounded I assume header bars detect that theya re in the title bar part of the window, and that they are at the start of at the end of the window, and that they draw their corner rounded or not depending on that Am I correct? :o
baedert (IRC): Kekun: No? Widgets just don't clip their child widgets to the rounded border box
Adrien Plazas: baedert: How can I make them not be clipped at the corners? Do you have a code example?
baedert (IRC): Kekun: they aren't being clipped, that's the problem presumably. The header bar gets the rounded corners because of CSS, but your child widget does not.
Adrien Plazas: I tried putting a revealer in a header bar and the behavior is exactly the same as with the leaflet
baedert (IRC): in a header bar? Or you used the revealer as a titlebar?
Adrien Plazas: I meant in the title bar my layout is, a box, containing an expanded header bar at the start, a revealer at the end with a sliding animation, and the revealer contains another header bar Here is a demo of the issue in pure GTK+ 3 https://source.puri.sm/adrien.plazas/corner.git
baedert (IRC): It's the same mess as split headerbars
Adrien Plazas: Couldn't windows force to not draw on their corners? Or edraw the corners cleanly (I suppose these approaches are very anive) *naive
baedert (IRC): the css box needs to match so borders are drawn correctly. Otherwise you're just cutting them off
Adrien Plazas: Any idea how to solve the issue? Even if the fix is only available with GTK+ 4 Actually… I didn't even check if that bug occurs with GTK+ 4
baedert (IRC): it does
Company (IRC): what are we arguing about?
baedert (IRC): putting a headerbar in a revealer in a box and using the box as the titlebar for a window
Company (IRC): and what's problematic with that?
baedert (IRC): The header bar doesn't get rounded corners or something
Company (IRC): do header bars have a background? i guess they do
baedert (IRC): a three-stop gradient those bastards
Company (IRC): but yeah, unlike the web we don't clip contents to the rounded area it turns out that cairo doesn't like rounded clips - at least not if you want your drawing to finish today but isn't there just some style class you have to set on the headerbar to get it to behave like a regular headerbar?
baedert (IRC): We can't do it anymore in gtk4 at all I guess since we even removed clips
Company (IRC): we can easily add a snapshot_rounded_clip() to gtk_widget_snapshot()
baedert (IRC): otoh GtkWidget:clip-shit could be nice anyway to avoid re-implementing ::pick in GtkViewport etc.
Company (IRC): the problem with that property is probably that everyone wants slightly different semantics about what to clip maybe not if you want to go for it, it's certainly worth trying
baedert (IRC): Kekun: you heard that?
Company (IRC): and if you can get viewport, window and the notebook tab bar ported to it, it would make a good argument or we could just have a GtkClipBin widget that does this and liberally use that one i'd like a better name though GtkClippy
Company (IRC): that name would seriously be my suggestion btw (until somebody has a better one)
baedert (IRC): GtkClipper
Adrien Plazas: Trying to sum things up with my shallow unterstanding of GTK+: we could just put everything in the title bar into a GtkClipFoo GtkClipFoo would take care of rounding the corners using… I didn't understand what exactly yet Ah gtk_widget_snapshot() is new, that's why it didn't ring a bell O Nah I think I'm lost, you were talking way beyond my understand of GTK+'s internals, especially GTK+ 4
Company (IRC): Kekun: you can clip in GTK3 using cairo_clip(), too it's just that when you do that, cairo tends to get slow - that doesn't matter for a headerbar that almost never repaints anything, but it does matter for regular stuff Kekun: but for your problem the best solution is to make sure the same css applies to your headerbar as applies to the regular window title headerbar
Adrien Plazas: CCompany: can you point me to the rules to draw the rounded corners in GTK+ 3?
Adrien Plazas: I have trouble understand where they are, in GtkWindow? In some style class? And more importantly, how could I apply them to some other widget
Adrien Plazas: (to enforce them)
Company (IRC): Kekun: from that question i take it that you have never looked at themeing and css?
Adrien Plazas: CCompany: not as much as I wished :| Let's just say "no" I would happily do the work to fix that issue but I lack a ton of knowledge to do so
Company (IRC): Kekun: if you want to but weird stuff into your window title, you have to acquire that knowledge Kekun: alternatively, put a regular headerbar there and deal with it
Adrien Plazas: Oh I'm not against acquiring it, I just have no idea where to start :p
Company (IRC): Kekun: the inspector has css nodes for the headerbar
Adrien Plazas: I just can't put a headerbar there, I need leaflets to work in header bars :|
Company (IRC): Kekun: you want to look for the border-*-radius ones in a rounded headerbar
Adrien Plazas: OK
Company (IRC): Kekun: those properties say where they are defined Kekun: then you have to find that part in the theme and see if and how you can replicate that with Adwaita you'll end up somewhere in gtk-contained.css with some weird selector
exalm: Adrien Plazas: https://gitlab.gnome.org/GNOME/gtk/blob/master/gtk/theme/Adwaita/_common.scss#L1657 is where they are defined and https://gitlab.gnome.org/GNOME/gtk/blob/master/gtk/theme/Adwaita/_common.scss#L1604 is where they are squared for tiled windows Adrien Plazas: also https://gitlab.gnome.org/GNOME/gtk/blob/master/gtk/theme/Adwaita/_common.scss#L4300 here