I’m currently working on my second GNOME extension, and while reading documentation and reading through the code, I noticed that ST is archived and that for the future it would likely be replaced with GTK. This got me thinking: why wasn’t this done originally when GNOME 3 was first developed?
This is not really a pressing matter, just some GNOME history that interests me.
Thank you for your time!
There’s a very interesting history lesson here… I wish I had time to go back into it all.
I think the main reason would be that back in 2008/2009, GTK didn’t cooperate with 3D accelerated graphics. We used a separate library (Clutter) to do 3D acceleration and St was built on top of that. Now Clutter is also merged into GNOME Shell
BTW, i went back to Emmanuele’s “history of GNOME” podcast to see if this was covered, but seems he didn’t get there yet
The two main reasons for not using GTK in 2009 (when the gnome-shell project was first started) were:
lack of hardware accelerated rendering in GTK
inability to use a client toolkit like GTK inside the window manager process
Sam has outlined the first issue; the second one is inherent to both GTK and X11 window managers: GTK expects all top level windows to be managed by a window manager, and if the window manager is the process creating them, it can only do so by creating separate processes—the same kind of design of GNOME 2 and its panels, which has inherent limitations.
Once we switched to Wayland, a third issue has appeared: GTK has no native frame buffer rendering backend, and no direct input backend. GTK under Wayland is designed to ask and commit rendering buffers to the display server/compositor, and get all input events from the same source. GTK cannot render directly on the screen, and cannot poll events from the kernel interfaces.
There is currently no plan to switch Mutter and GNOME Shell to GTK; you probably read a page on the wiki which is there only for “aspirational” purposes. Nobody is working on implementing that particular architecture, and it’s not really an easy thing to do on somebody’s spare time.
For the foreseeable future, the Shell will continue to use Clutter for the scene graph, and St for specific widgets.
So it wasn’t actually St, but the underlying Clutter library. It also isn’t the current Clutter codebase (which I believe is part of the GNOME Shell repository now), but an archived repository. It states in the README.md:
The planned replacement for Clutter is GTK 4.0.
This could also mean that for new projects, GTK should be used instead of Clutter and not that it will be replaced in existing projects (like GNOME shell). My bad for misunderstanding!