Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's not quite accurate, let me try to explain it. GTK3 and GTK4 both support a kind of limited "theming" with CSS, and that hasn't changed. In GTK3 before certain versions, the CSS selectors were unstable, so theme developers were relying on something that was going to break. Even after the CSS selectors have been stabilized, it's only really safe for applications to change those selectors. Third party CSS loaded into a running application will always risk breaking. It was (and still is) safe for applications to load themes besides Adwaita if that's something they tested for, but this has to be something done by the application. Not by a third party theme. That's what that website is talking about.

There was a tweet going around a while ago that I'll try to re-state. Adwaita is not really a "theme" it's more like a CSS framework that you build your app on top of. Trying to swap out the theme is like trying to take a site built for Bootstrap and putting the CSS from Foundation on top of it, you might be able to hack it to sort of get it to work but what you're doing is combining two things which are fundamentally not compatible. Hopefully that helps explain why the method that people were using for third party theming in GTK3 was unreliable.

In GTK4, the Adwaita theme has actually been removed from GTK and moved into libadwaita. That could mean some changes for some things, but not other things. Will all GTK3 apps port to GTK4 and libadwaita? Probably the GNOME ones will, but other apps might not. In that case it would be up to those developers to come up with a solution for theming, they could try to base that on CSS, or they could do something else.



Thanks for the explanation!

> Will all GTK3 apps port to GTK4 and libadwaita? Probably the GNOME ones will, but other apps might not

I have a question. Does it make sense to start new apps with GTK3? E.g. if I want my app to look at home in MATE/Xfce (which currently use GTK+3), and don't want to touch GNOME in any way, does it make sense to write it in GTK+3 (using GTK+2 HIG)?


You can do that, but I don't know if I'd recommend it. You'd have to think about what your requirements for the application are. GTK3 is currently stable but will not gain any new features, and all progress is happening in GTK4. So if you don't need any of the new features then you could use GTK3.

Personally I don't think the look needs to be a major factor in your decision though. If you wanted some new features from GTK4 and wanted it to "look at home", and you really wanted to not use any GNOME APIs, then you could avoid using libadwaita and apply the theme yourself. Libadwaita is only useful if you want to follow the current GNOME HIG. I think if MATE/Xfce want to upgrade from GTK3 they would have to do this eventually anyway, and it would actually probably provide a better experience than GTK3 themes did. Also, GTK never had a HIG. You're thinking of the GNOME HIG, and the GNOME 2 HIG is pretty out dated. I think even MATE/Xfce would want to change some of those things in there that we know don't work well with the benefit of 15-20 years of hindsight.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: