But your API suggestion was gtk_application_request_ssd()
, not gtk_application_request_ssd_where_supported()
.
Yes, GTK will add default decorations where necessary if no custom titlebar was set, but that is not SSD.
If you want an API that allows an app to choose between “guaranteed CSD” and “a default decoration that best suits the system”, then you already have gtk_window_set_titlebar()
.
Currently the default is not CSD, but depends on a variety of factors:
- custom titlebar → CSD
- broadway/windows → CSD
- wayland → CSD, unless the compositor prefers SSD (via kwin protocol)
- X11 → SSD
The only thing that wrong there IMHO is the use of the kwin protocol instead of xdg-decorations.
Given that SSD are not universally supported, an API that allows an app to explicitly request SSD would be wrong.
What an app can do (without any API additions) is to not set a custom titlebar, which leaves decorations to the system/toolkit (in other words: SSD will be used where supported).
Yes, and I don’t understand what else would be needed on top of that.
My point is that “request SSD” implies that SSD will be used, while not setting a titlebar means that SSD may be used.
IMO an API for explicitly requesting SSD is either broken (where only CSD is supported) or a lie (because it ends up using CSD anyway).
Eeks, I was only looking at what GTK is doing today with the kwin protocol. Yeah, we can’t have a global property when the protocol is tied to a surface.