How's POP!_OS COSMIC development going?

How's POP!_OS COSMIC development going?

A bit of time ago, I published a video about what System76 was doing with Cosmic, and back then we were so early in development that I had to, you know, look at reddit comments to find useful information. Since then, the team has been publishing blogposts about the development in a somewhat regular way, so I think it's time to go through them to see what's new and also give them some credit, because they're doing super interesting things.

Let me quote the words that open the latest Cosmic update: "Ahh, spring. Sun is shining, birds are chirping, and COSMIC is blossoming into a beautiful desktop environment prototype". That's quite a promising line, but what's new?

Firtsly, there are some user-facing changes that are nice and don't feel too technical. There's a new look for the launcher, as an example, with your search results, buttons to open new instances, and also the shortcut for each application on the right side of things. Looks good and clean.

There's also changes in how Maximize and Full Screen work; or, to say it in a different way, they decided to get rid of the fullscreen option for applications since doing setting the panel as auto-hide or intelligent-hide is almost the same thing. Almost, though: fullscreen used to also get rid of the titlebar, whereas the new setup - with a normal maximize and a hiding panel - will always preserve it. This is, you know, actually quite standard in desktops with maybe the exception of what MacOS does.

Or, still on the user-facing side of things: there's search in System Settings, obviously. But what's different here is that the results of the search will be displayed in just one continuous scrollable list of search results from the various settings panels, which is extremely interesting. In most Settings apps, you just get a list of sections and then you have to, you know, click on one before being able to change anything. The idea to just display in the search result the content of all possible pages is fascinating to say the least.

System Settings are a big part of a desktop, actually. I do say that whilst beaing a KDE developer, which probably has the most power-packed system settings application of any other desktop. If I were tasked to re-implement system settings from scratch I would probably take the first flight to another country and ask for political asylum, but re-implementing system settingns from scratch is what System76 is doing. The cool thing is that the have mockups on Figma that are extremely detailed on what each button does, and lots of them have very interesting concepts.

As an example, it has happened that somebody got in the KDE Visual Design chat showcasing the mockups from System76 and asking, well, we aren't we doing this? And it's quite cool that they're able to do these good mockups whilst still being very consistent with their intended design, and that the implementations also follow that very design. Interestingly enough, there is one feature that they promise and that KDE Plasma, or any other desktop environment I've tried, actually lacks entirely, and it's related to displays.

So, there will be a display section in the settings, obviously, and you'll be able - for each monitor - to customize graphic modes here, such as the color profiles. But also, this is where Night Light will live, which is the feature which filters out the blue light after sunset. You will be able to - and this is the unique feature - setup Night Light differently depending on the display, such as one display actually gets blue filtered whereas another one doesn't. I've never seen any other deskotp do this. But, to be fully honest, I also don't quite see any reason why you could do this, so heeeh, it's not really on my to-do list. Let me know in the comments if I'm just blind to the potentiat this idea has ;)

Now, these changes hide a bit the fact that what System76 is trying to do is, you know, reinvent the desktop entirely, and this comes with lots of complex under-the-hood problems. As an example, you know that Pop!_OS has crazy good tiling options, which allow you to switch between floating and tiling mode and such? Well, that works closely to the desktop environment, and if you change that, you need to re-implement a lot of stuff. Which is why in their latest blogpost System76 flex the fact that now Tiling on COSMIC almost works as well as in the previous Pop!_OS update. Almost. We do have active hints and configurable window gaps, but we don't have stacking.

Or, as another example, COSMIS is slowly telling us which widgets that were working on the latest Pop!_OS are now also on the master branch, given that - again - they did things from scratch. As an example, just in February the Bluetooth applet joined the club which also includes the biggest one: clock, Wi-Fi, notifications, battery, and so on. We do not have any screenshots of that, but I'm quite interested in seeing how it turns out given that they started with some great mockups and designs and they seem to following the path of implementing things exactly like pictured in the mockups, which is impressive.

Which brings us really deep into the technical changes, which is the more interesting side of things, actually. What System76 is doing is writing the Desktop from scratch in Rust using a new GUI toolkit, which is not GTK, not Qt, but it's called Iced. On one side, it's a pretty darn cool toolkit that's also cross-platform, meaning you can do apps for Linux, yes, but also Windows, macOS and for the web. On the other hand, it seems still in early development; to make an example, if you click on the documentation every single page is marked as TODO, along a big "work in progress" warning. This does have some effects on the development of projects like desktops using iced, as iced lacks some important tools that COSMIC have to implement. One of these is managing animations, which is why the System76 team worked on writing their own animation crate, called Cosmic-time, to manage the desktop animations, a big deal!

I do really like, though, the side effect of this development here. The fact that such a big project decided to use iced is - I think - actually helping the toolkit as well. Now any developer can use this cosmic-time crate to do their animations, not just System76. In fact, that's already happening in a project called bazaar (which, I think, is some sort of application manager?). Bazaar is not a project of System76 or Cosmic, but it is using the cosmic-time library, which is dope.

Back at COSMIC, there are other issues as well in writing a desktop from scratch. As an example, you have to manage wayland clients, and you need a library to do so that's, you know, in rust, like for iced. Cosmic decided to go with a project called Smithay, which does just that, writing wayland clients in rust. However - again - some features were simply lacking and they had to add them by themselves. Namely, drag and drop support. Which sounds like a big deal. But again, the team has worked to make sure those changes were upstream, directly to the Smithay repository, meaning that now any project that decides to use that same toolkit will benefit from the work done by System76 developers.

Or, to make yet another example of an upstream contribution made by COSMIC developers: dynamic rendering. The idea is that "your computer has diffferent ways of rendering visuals, depending on what software you're running and whether or not your system has a dedicated GPU. Dynamic rendering solves for this by determining what rendering program your system should use: OpenGL or Vulkan if you have a GPU, or Softbuffer if you don't". Now here's the issue: dynamic rendering has to be implemented by the toolkit iced, and they didn't. So, the lead developer Jeremy went at it and simply implemented it, also adding software rendering in the process. This was not implemented as cosmic dash something, but rather as iced dash dynamic rendering, which means again that any program using iced will benefit from this nice addition.

Developers are also working on adding new widgets, and you might - maybe not but - you might be sligthly confused about what those "widgets" mean. Basically, widget is the name to any re-usable component in the GUI toolkit, so: buttons, sliders, progress bars, comboboxes, you know, this sort of stuff. As an example, this is a recently introduced widget in libcosmic: the SegmentedButton, something - by the way - that KDE is often also tempted to implement but that didn't ever quite got anywhere.

Then, there's performance improvements. In this update, improvements to cosmic-text has managed to cut RAM usage in half. Again: cut RAM usage, in half. Also, it's half a second faster. And the team even claims that bringing these improvements to the libcosmic library itself will make sure that all app using it, including the desktop, will receive boost in speed as well. When talking about the text editor, remember that we're talking about something that was written entirely from scratch just last month, so, that is quite impressive.