Barcelona: LAS 2019

This November I was in Barcelona for the Linux App Summit 2019. It was awesome \o/. I really liked that the conference was a joint event by GNOME and KDE, I met so many cool new people. During the conference I volunteered to show the “time left” signs to speakers, and helped out at the registration desk.

Aside from normal conference stuff I also managed to do quite a bit of hacking during the week. I made my first contribution to Gnome Initial Setup, and cleaned up Teleport a bit so I can hopefully get a new release out soon.

I’m bad at taking pictures, so here’s a picture of a tree in the middle of the stairs on the slopes of Mount Montjuic.

Thanks to the GNOME Foundation and Purism for sponsoring my travel and accommodation. The whole event was a lot of fun, so my thanks also go to all the organizers and people who helped make it happen!

GUADEC 2019

This year I did a bit of traveling in Greece before going to GUADEC in Thessaloniki with Tobias, Regina and from Athens Jordan. We started from Kos, a small island close to Turkey. After a couple of days we took a ferry to Athens, where we met up with Jordan, our local tourist guide ;)

Regina, Tobias, and I in front the Parthenon.
Jordan as archaeologist ;))

After visiting Athens and the Acropolis we took upon us the long journey to the oracle of Delphi. Close to Delphi is Mount Parnassus, one of the highest mountains in Greece. Sadly we didn’t manage to climb the peek, but we still had an awesome hike around it.

Mount Parnassus

After the holidays we took the train to Thessaloniki to meet with other Gnomies. Sadly Regina didn’t join us for GUADEC.

So, what have I been up to during GUADEC:

I finally got the icon export feature merged into Icon Preview. I fixed issues with this literally right up until Jakub’s demo, but it was worth it: During his demo the export worked flawlessly. As soon as there’s a new release, you’ll be able to export hicolor and symbolic icons directly from the same template, which improves the icon authoring experience a lot. You can also export a nightly version of the symbolic icon, which is automatically generated with no extra work. We’ve wanted this for a very long time, and it’s great to finally see it come to fruition. Expect Nightly icons in nightly versions of GNOME apps soon!

I also created a new tool (still work in progess) which takes an SVG file and exports a PDF where each page is defined by a rectangle with a specific size and color. Some people (i.e. GNOME designers) like to make their slides in Inkscape (since it’s the only decent free visual editor we have), but since Inkscape doesn’t support multiple pages it’s a real pain to export the slides to PDF. The code isn’t ready to show therefore it isn’t public, yet. I hope to make this into an actual app soon though, to make this workflow feasible for more people.

I also talked to a couple of people about the future of folks (the library powering gnome-contacts) and what possibilities we have to improve the status quo.

Many thanks to everybody involved in organizing GUADEC. It has been a lot of fun, I can’t wait for next year. Special thanks also to the GNOME Foundation for sponsoring my attendance!

Rust Hackfest in Berlin

The Rust hackfest was a few months ago, so apologies for the delayed blog post :)

It was a lot of fun hanging out with all the GNOME people who were in Berlin for this. I unfortunately had some unexpected deadlines from my University.  Therefore I couldn’t hack as much as I wanted but I still got a couple of things done.

I spent most of the time on an example which shows how to implement drag and drop reordering of rows in a GtkListbox which is bound to a ListModel. Sadly I didn’t have the time to fix the few reaming issues (mostly commenting the code), therefore it’s not yet merged. This is the pull request to gtk-rs.

I also worked on Icon Preview to integrate librsvg, so we can have nice nightly icons and the designers can create the hicolor icon in the same file as the symbolic icon. Icon Preview isn’t in Rust, but I filed a couple of issue in librsvg and did some testing there.

Playing “War on Terror” with Regina, Tobias, and grumpy Jordan

Thanks so much to the GNOME Foundation for sponsoring my travel, and to Tobias and Regina for hosting me. Also many thanks to Zeeshan for organizing the hackfest.

Design Tool Hackfest 2019

Last month I was in Berlin for the “Design Tools Hackfest 2019”. This whole thing started during last year’s GUADEC in Almeria, when I started playing around with cairo and librsvg. Because of that I got pulled into some discussions around improving tooling for GNOME designers, especially around icons.

During this hackfest we worked on three main issues:

– How to extract multiple icons contained in a single SVG file as separate SVGs (e.g. the stencil file in adwaita icon theme)
– How to generate Nightly hicolor app icons automatically
– How to export optimized icons directly from Icon Preview

The third point comes more or less for free once the first is done, so we focused on the former two.

Gnome Stencils

Splitting the stencils into different files is currently done with a script which uses Inkscape. This is very very slow because it has to open Inkscape for every single icon.

As far I could find there are no libraries which would allow us to manipulate SVG files in the way we need. Therefore I’m using cario and librsvg to generate the files. This approach may sound crazy, but it works quite well. The basic idea is to render an SVG file into a cairo surface with librsvg and then export the surface via cairo as a new SVG which contains only the part we’re interested in.

Nightly Icons, generated with svago-export

This way we can even use cario masks to automatically render nightly icons, and I started integrating this into Zander’s Icon Preview.

 

Sadly I’m currently quite busy with university, so I didn’t get around to finish and clean up svago-export so far, but if you want to have a look at the experiments I did feel free to do so. Luckily, the semester will soon be over and I will have more free time \o/

Special thanks to Tobias for hosting the event and thanks to the GNOME Foundation for sponsoring my travel.

Another year, another FOSDEM

I have come a long way since my first time at FOSDEM a couple of years ago. The first time it was all new and unknown. I tried to attend as many talks as possible, but could only see half of the talks i wanted to go (amazing how many people there are at FOSDEM). Every year I listened to fewer and fewer talks, because conversations I had outside of talks are so much more fun and appealing. I think the biggest thing which changed is that I’m no longer just a user of free software, but an active contributor.

This year, I spent a lot of the time at the GNOME booth, which is always fun. The GNOME beers event is also awesome, though it was really crowded this year (let’s hope we get a bigger space next year). On Friday we also had a great lunch at a Libanese restaurant. Thanks to Adrien for organizing, and thanks to Purism for offering lunch.

While there, I also did some work on Fractal. I investigated why Fractal uses a lot of CPU and memory and made changes to reduce memory usage.

I stayed at a flat together with Bastian, Niclas, Florian, and Tobias. Thanks a lot for the good time in Brussels, especially to Bastian for organizing the apartment. Special thanks to the GNOME foundation for sponsoring the trip to Brussels.

Fractal Hackfest in Seville

Last month I was in Seville for the second Fractal Hackfest. It was a bit of a different experience for me than the other hackfests I have been too, as I’m a core member to the project now, and I also knew most of the other people already.

My main focus for this hackfest was to push forward the work on the Fractal backend. The backend should handle persistent storage and the preparation of data needed in the UI. Right now many things which should conceptually be in the backend are in the frontend, and can therefore cause UI freezes. Over the past months I have been working hard on refactoring the code so we can just drop in the backend without making many changes to the UI code. So the core of the refactors I did was to make sure that data flows in one direction and we don’t keep different copies of the data around.

Backend

For storage we decided to use SQLite instead of LMDB because we have many relations between the data. The data will be structured into 3 tables: USERS, ROOMS, MESSAGES. This gives us a lot of space to expand and allows us to reference to other data with ease.

The backend will have use a glib based API to communicate with the frontend, and on the other hand it will have a Rust only interface to communicate with fractal-matrix-api.

Community

Lunch at a spanish Pizza place

We also had really awesome community bonding events, and some local newcomers joining the hackfest. Thanks to Daniel for organizing the event and also all locals who helped him.

I fell in love with GAction

A few weeks ago, while working on Fractal, I rediscovered something I had completely forgotten about: GAction. I don’t remember how I came across it, but it was definitely love at second sight, because for the next days I didn’t do much other than refactor Fractal and replace code with Actions wherever I could.

Of course, if you like something a lot you have to be careful to use it only where it’s appropriate. For me it was basically when it’s a user action then it should use GAction, or in other word if it’s a response to an user input, like clicking on a button, then it should be a GAction.

Now, how do you use GAction? Since GAction is only an interface we need to use a class implementing it. The most simple class we can use is of course GSimpleAction as the name already implies. Since I’m writing most of my code in Rust these days, all examples will be in Rust.

// We have to create a SimpleActionGroup
let actions = SimpleActionGroup::new();
// Currently we can't use any Variant type we want, we are limited to the most basic ones like strings, numbers, and bools
let reply = SimpleAction::new("reply", glib::VariantTy::new("s").ok());
// And then we have to add it to the ActionGroup
actions.add_action(&reply);
// The last thing we have to do is to connect to the activate singal
reply.connect_activate(move |action, data| {
//Do whatever you want in here, e.g. open a file dialog
});

The above code shows how an action is created. Let’s see how you can use it.

The first thing we need to do is add the created ActionGroup to a Widget. The action will then be available for all children of that widget, so it’s best to add it to a Container or a Box which allows us to have children.

// Create a Box
let b = gtk::Box::new(gtk::Orientation::Horizontal, 0);
// Add the action group we created before to the widget
box.insert_action_group("something", &actions);

Now the actions are available to all children of the box with the prefix “something”. In our example “something.reply” would be the name of the action. Given a GTKButton you can set the action_name and the target_value of the widget, because it implements GtkActionable. The code basically looks like this:

// Create a new GTK button
let button: gtk::Button = gtk::Button::new();
// We need to use a Variant to store the string we want to set as the target value
let data = glib::Variant::from("some string");
// Set the action name
button.set_action_name("something.reply");
// We also need to set the target value
// If we don't do this, GLib will complain that we didn't call the action with the correct target and won't execute the action
button.set_action_target_value(&data);

You could also set the properties via the .ui file. When you replace the event handlers of clicks with actions you can really streamline your code base.

I showed the basic usage of the GAction in the above examples, but you should definitely have a look at the GAction documentation to see all the potential it has. Also, GPropertyAction is awesome because it allows you to control GObject properties directly via Actions. Sadly, the Rust bindings for it are not in a stable release yet, but they were added to master a couple of months ago.

Better Room History in Fractal

Over past month I’ve been sponsored by Purism to work on improving the message view in Fractal. This post will highlight the biggest and most interesting changes.

The first thing I improved was how older messages are added to the message view when scrolling back. Before, there was a jarring cut when new messages were loaded, but now you can just scroll upward and older messages are loaded continuously. This makes it much easier to search for a message in the history, because there are no sudden jumps when messages are added to the list. In the video you can see the how the smooth history loading works.

The part I’m most excited about is the new “new message divider”. Here’s a small screen cast to show the new behavior:

When the user opens a room they can directly start reading the conversation from the last seen message and they don’t need to search for the new message divider. Not only has the UX gotten a lot better, but also the underlying code is much cleaner now. Sadly, it doesn’t work (for now) if Fractal doesn’t have a “last seen mark” for the room. This can happen, for example, when there are more than 40 not seen messages. The reason for that is that Fractal only syncs the last 40 messages of a conversation. The new message divider also disappears after a couple of seconds and this time is not yet connected to how many messages an user has to read.

I also spent some time on making message rendering faster. I replaced the RegExp with more efficient code, this made the rendering much faster (from ~10ms to ~ 1ms) for every single message. This is already pretty good, but I think there’s still room for improvement.

In summary, all of these things improve Fractal’s UX a lot and make it feel more like a modern messaging app. To further improve the UX we need to also update the app’s backend and improve how we get data from the Matrix server. Thanks to Purism for sponsoring this work, Daniel for reviewing and merging everything, and everyone else who gave feedback and helped test this.

We don’t have a new stable release with these changes yet, but they have been merged, and you can already try them on Master.

Rust ❤️ GNOME Hackfest

Last week I was in Thessaloniki, Greece for the GNOME+Rust Hackfest #4. I liked the city, but sadly during the weekend we had really bad weather, and it was much colder then I excepted. The hackfest itself was awesome though. The thing I liked the most was starting to contribute to new projects. I guess it’s so much easier to get started when you have the maintainer sitting next to you and you can bother them with your silly questions ;).

I had some time to do sightseeing as well. The city has a long and interesting history. Everybody who goes to Thessaloniki should go to one of the most known monuments of the city: the white tower. It gives you a pretty good overview of the history of the city. And also the panorama view you get on top of the building is really good.

At the beginning of the hackfest I was kind a shy and worked mostly on Fractal, but during the next days I really wormed up and started contributing to the GTK Rust bindings and librsvg.

It was a lot of fun and I’m looking really forward to next year’s GUADEC, and to go back to Thessaloniki. Sebastian and Vivia, you did a awesome job at organizing this hackfest, thank you so much!

PS: the food was really good ;)

Purism Fractal sponsorship

I’m happy to announce that Purism agreed to sponsor my work on Fractal for the next couple of weeks. I will polish the room history and drastically improve the UX/UI around scrolling, loading messages etc. which will make Fractal feel much nicer. As part of this I will also clean up and refactor the current code. On my agenda is the following:

Smooth history loading

Loading old messages in the history is currently a bit jarring, because the scroll position isn’t preserved when new messages come in. I’d like to address this by loading messages outside the viewport, making it so that the user isn’t even aware that more messages are being loaded most of the time. This is a crucial part of why modern messaging apps feel so nice.

Faster message rendering

There are some inefficiencies in how messages are currently rendered, which make showing messages not as smooth as it could be. Fixing this could improve the experience of sending/receiving messages significantly.

 “New messages” behavior

  • Re-add a “New messages” divider, since it was lost as part of the big history refactor I recently completed
  • Scroll to last seen message when opening app instead of most recent message
  • Fix bugs in current behavior and make sure the divider always shows up

Add day label

Add a label with the day/date at the beginning of every new day, like other messaging apps do.