Development of Nautilus – Popovers, port to GAction and more

So for the last two weeks, I have been trying to implement this:

The popovers!

In an application that already use GAction and a normal GMenu for everything is quite easy.

But Nautilus is not using GAction neither GMenu for its menus. Not only that, Nautilus use GtkUIManager for managing the menus and GtkActions. And not only that, Nautilus merge parts of menus along all the code.

Also, the popover drawn in that design is not possible with GMenu because of the GtkSlider.

So my first step, when nothing was clear for me, was to just trying to create a custom GtkBox class to embed it on the popover and try to us the current architecture of nautilus.

It didn’t work, obviously. Fail 1.

Then after talking with some Gedit guys (thanks!), I understood that what I needed was to port Nautilus to GAction first. But, I will have to find a solution to merge menus.

My first week and a half was trying to find a solution on how to merge the menus, along making the port to GAction and refactoring Nautilus code to make it with sense and being used to the code of Nautilus.

The worst part was the complexity of the code, understanding it and the its intricate code paths. Making a new application test with GMenu and popovers merging menus was kinda acceptable.

To understand why I needed to merge menus recursively, this was the recursion of nautilus menus that was done with GtkUIManager along 4 levels of classes. That diagram should have more leafs (more classes injecting items) at some levels, but this was the most complex one.:

Dibujo sin título

So after spending more than a week trying to make it work at all costs,  I figured out that merging menus recursively in recursive sections was not working. That was kinda frustrating.

Big fail 2.

Then I decided to get another path, with the experience earned along that one week and a half.

I simplified the menu layout, to be a flat layout (still I have to merge a one-level menus, so a new way to merge menus was born), put all the management of the actions on the window instead of having multiple GtkActionGroups sparsed on the code as Nautilus had previously, make the update of menus centralized on the window, attach the menus where it makes sense (on the toolbar), and a beautiful thing, the toolbar of nautilus (aka header bar) is now on a xml gresource file, not longer making it programatically =).

That last thing required to redo a good part of the toolbar, to for example use the private bindings that GObject provides (and then be able to use gtk_widget_class_bind_template_child_private) or sync the sensitivity of some widgets that were synced directly modifying the actions on the window instead on the toolbar, etc.

And thanks to the experience earned in the fails before, it started working!

Then I became enthusiastic to add more and more part of nautilus ported. After the prototype worked this morning, all was kinda easy. And now I feel more (like a very big difference) confident with the code of Nautilus, C, GTK+ and GObject.

Here’s the results

nautilus-view-menu

nautilus-action-menu

It’s still a very early prototype, since the port to GAction is not completed. I think I have 40% of the port done. And I didn’t erased all the code that now it’s not necesary. But with a prototype working and the difficult edges solved, that doesn’t worry me at all.

Work to be done is:

* Complete the port to GAction, porting also all menus.

* Refactor to make more sense now with the current workflow of menus and actions.

* Create the public API to allow extensions to extend the menus. Luckily I was thinking on that when creating the API to merge the menus inside Nautilus, so the method will be more or less the same.

* And last but not least, make sure any regression is known (this is kinda complicated due to the possibly code paths and supported tools of Nautilus)

Hope you like the work!

PD: Work is being done in wip/gaction but please, don’t look at the code yet =)

First day at Red Hat in Brno

Finally I’m installed at Brno and yesterday was my first day at Red Hat.

Moving to Brno was easy because I just bring with me a cabin luggage. First day at Red Hat was a little accidental. It was raining and I ordered a taxi, but guess what, it didn’t come so I had to run to the building… But I’m still alive =P Some beers with Alberto, Rui and Debarshy (Fabiano couldn’t come that day) makes it better indeed.

IMG_20140928_213253

Here at Red Hat is pretty nice, you have all the commodities you could imagine like resting room with PlayStations and pool table etc. or massages room or a little gym. So you are sometimes tempted to skip work =P

IMG_20141001_132629

Also I have to be careful with my weight, because there are a lot of food and people normally go outside to eat, and here is not very common the healthy well balanced mediterranian food (although I found restaurants already that they do).

IMG_20140929_105448

Also Red Hat put some food free here… =)

IMG_20141002_093955

So, on the technical side:

I will work on Nautilus! I think my manager made the best decision on this. I want and need to learn Gtk+ and gobject + C, and a big project like evolution or so is kinda difficult for a starter. On the other hand Nautilus needs some love and there are a lot of places to improve, both in the UI(popovers, new mockups) and the “backend” (search as you type I’m looking to you!)

But I won’t leave gnome-shell, I would like to keep at least improving what I already worked on. That’s App picker and Overview. Also I have some patches waiting to be improved or getting review and merge them. Not just that, part of my work is to work on gnome-shell, so it’s not just a personal preference =)

So I’m very happy to be here and working at Red Hat in its work ambient. I really feel like  in home thanks to Alberto and colleagues and the relaxed workflow of Red Hat (as in be free as long as you make a good work in what you are supposed to do).

I’ll be update this regularly with my improvements in Nautilus, and I hope you like it.

Cheers!

Gsoc ending!

Hi,

So after some months, the GSOC on gnome-shell animations improvements ends. We achieved to land all the code before .91 to be included in the 3.14 release as we wanted.

The work accomplished included improvements on the app picker transitions, the folders transitions,  the overview transitions, and some bugfixes and clean-ups we considered were important to have.

You can see the visual part of the work in the next video

I’m very happy all the work was landed, and I want to thank my mentor Florian Müllner for his effort and patience =)

Guadec?… GUADEC!

This year I was sponsored to go to Guadec like the last year, so although a student budge is not that big to go to a city like Strasbourg for 8 days, Guadec brings a good opportunity and I didn’t want to lose it.

I traveled with Florian Müllner most of the time (except the flight), and it was pretty good to see him again affter one year, so we had a lot to talk on the train =)

As other said/will say, Guadec started with great talks, which I would like to empathize the Gnome builder talk, which I consider a key to bring new contributors who now, at least on my university, are use to Java/Android + Eclipse. For what I know, what Christian did has no precedent, and I thank him a lot for that (and I guess all gnomers do).

On the other hand, Emmanuele talk about clutter inside Gtk+ was the other one that I really liked it and that I followed the progress, hoping to see some practical results soon.

Oh, for first time I was less nervous in my public talk, which is a big achievement and a big deal for me!

Then, on practical goals, I discussed few things for projects I have and I have now a TODO  about the direction we should take for those projects. Those projects include a improvement on the gnome love wiki pages to make newcommers life easier; a secret little project about trying to make first time use of fedora easier; and I spent two afternoons with Florian reviewing the code of my Gsoc, that by the way, the code is done, but I have to apply some reviews to make it good enough for upstream, so expect great news soon.

Thanks Gnome for sponsoring my travel, and thanks to all of people who help me to do what I want to do, hacking Gnome!

 

Make theme authors’s life easier – Support margin property in CSS

The past week I tried to give the GTK+ popover design to popovers in gnome-shell.

That meant to add margin to the items. But, I noticed gnome-shell doesn’t allow that. So I had to do a lot of code refactoring just to provide some margin to those actors. Indeed it was not a good solution.

Yesterday, I read that some important theme authors ( https://plus.google.com/101681698460010159459/posts/FTed9FNxtiF ) felt like gnome-shell lack support of the necessary css for them, tough they kindly understand why. Some authors solved the margin issue in their extensions of gnome-shell. At the end we had some authors that apply a solution “downstream” while upstream is waiting for that functionality.

So I really encourage those people that, if you found something that could be added as a functionality, make a patch for upstream instead of creating their own solution that no one can benefit of. All of us will appreciate that! =)

Most of the times, if something is ugly, if some functionality is missing, etc. it’s because we need patches, not because we don’t want them. But I understand that feeling.

As always, I saw a challenge there. So I implemented CSS margin support for gnome-shell!

https://bugzilla.gnome.org/show_bug.cgi?id=728437

Now, all the code I did for matching GTK popovers design in the past week that was 180 lines of code, now is reduced to just:

.popup-menu-item {
spacing: 12px;
margin: 0px 10px;
border-radius: 4px;
}

I would say, it’s looks much better!

And the result:

Image

 

I hope theme authors and designers are a little more happy now =)

Important to say that this work wouldn’t be possible without Florian Müllner helping me very close and Emanuelle Bassi that is always there for answering.

 

Gtk popovers item design for gnome-shell

Free time contributors to gnome contribute because they like the project and also to experiment things.

Sometimes I contribute to a patch that I see is difficult for me just because I like challenges, and gnome is a great place for that.

In the last two weeks I experienced both.

The first thing, as the tittle say, I tried to match gtk+ popover design for gnome-shell, and so far I achieved it! It was just a experiment, so I didn’t even ask designers if it is the wanted design before trying to do it. So it was risky, because maybe I was doing it wrong.

Here’s a comparison image:

Image

and the bug report: https://bugzilla.gnome.org/show_bug.cgi?id=727771

After some kind discussion, designers agree that this is not the wanted design, and that the first one is clearer, and probably is the desing that gtk+ popovers should have, and not backwards. And yeah, they are right! That is why I’m a programmer and they are designers =) (tough of course I guess they accept opinions from everybody, and even more if you provide code to test it in real).

But after all, I did it for experiment new things, so I hope designers don’t feel bad for “killing” the effort =).

In the good side, I fixed a somewhat related  bug in the meantime, which probably it wouldn’t get fixed if I didn’t try to do this.

 

On the other hand, last week I made a challenge. In fact three challenges:

1- Learn how shaders works

2- Modify C code from gnome

3- Learn how mutter works

So after all, and in very little measure, the next bug have all of this, so I tried to fix it:

https://bugzilla.gnome.org/show_bug.cgi?id=700081

After one day and a half, I finally achieved to make a set of patches to provide gnome-shell a real(real because it have inner and outer radius) vignnette effect! Also solving a bug that prevented to have gnome-shell and mutter vignnette effect to match.

So after all, I’m kinda happy I did two set of patches that were a challenge for me. Hope I can maintain this continuity along the weeks (probably I won’t be able)

Swarm animation for gnome-shell

There’s been long time I didn’t post. Normally I don’t like to spend time writing post, and instead I like to make things happens instead.

But today is not the day =)

This year I also applied to GSOC for gnome-shell (and in fact, to whatever gnome needs). The project will be to add a swarm animation to the gnome-shell. Here’s the link of the animation I have to achieve:

So far so good I tried to implement a prototype, and it kinda works. You can test it at:

https://git.gnome.org/browse/gnome-shell/log/?h=swarm

BUT, I’m being a bad boy here and I’m tricking clutter, so don’t look at the code.

If I become elected for gsoc I’ll end this project and probably do other things on gnome-shell, polari, or whatever gnome needs to push the next release, since it seems that I can end the project before gsoc ends.

Hope you like!

Guadec 2013

Hi,

Since gnome sponsorship my travel and accommodation in Brno –  Czech Republic, I was be able to go to Guadec this year, and it was a grateful experience!

I meet people I was working with in IRC chat, so, they had no face, no voice, no person! So meet them in guadec was a very good experience and good opportunity to talk, discuss, work together and finally take some beers with them.

First day was a little chaotic for me, my fligth was overbooked, so I had to take a different flight, going trough Munich, and then arriving to Wien. That middle flight was delayed (hehe good luck Carlos!) So I landed in Wien at 17:30, instead of 12:30 as it was expected. So I lost my bus from Wien airport to Brno. Also my mobile phone was broken in the middle of flight so I have no way to call people from guadec to help me to know what I have to do when I arrived to Wien to go to Brno without the required bus. So I take a train to middle of Wien, I lost 2:30 hours asking people where’s the main train station to go outside Wien. I guess people were like me, since nobody knows or they told me (yes! just put the destination in the display! =)) but no, destinations were only inside Wien. When it was 20:30h I decided to go to an hotel and sleep that night in Wien and hope for more luck at the next day. But, in a hit of luck, the receptionist told me that I have to go to middling train station, which is where I can get a train to go outside Wien. GOOD!

When I arrive to middling station, the first train was at 1:30h, so a little late to take a train  and arrive to a city I don’t know. So I ask for the first train in the morning, they give me a ticket BUT told me that to take that train I have to go to West train station (really?? =( ) so in another aventure I manage to go to the other train station. I sleep in Wien and then, go to Brno next morning. In Brno I was very lost, since I follow the instructions, but when I arrived to semilasso I have not clue where the guadec was, since it is not “here”. So after an hour searching and asking I finally see some people with the badge, so I finally was in GUADEC!!

After this, the core days were a lot of interesting talks and parties, and a lot of lunchs. That was the best part for sure! Not too much to say, since it was all very very good experience and difficult to explain, just you have to experience it for yourself!

 

9440936775_9c86459065_o

Then I did  my internship talk. I’m very nervous in these situations, although people strove to relax the speakers like me, but I was nervous anyway haha. After core days, I worked in my project with my mentor Florian Müllner who taught me how to rebase and squash patches, aside a lot of tips to work with.

So the overall experience was very good, and I hope I can go to Guadec – ES in my country, and or course the next Guadec =)

Nice to meet you all!

First month of work with the app picker

Hi folks,

First of all, the result of one month of work! Go to next video:

I did the most hard work and it is something ready to see how it works. There’s some bugs(lot of bugs on different screen resolutions) I noticed and also the code is pretty ugly, so no, it is not still ready! =)

The work I already done until now is:

-First, makes the all view with pagination. That’s it, makes browsing the apps like “pages”. That work involves do it touch friendly (pan correctly the view depending of the velocity you pan, etc) and makes the grid works as expected  (adapting the spacing between items, but with a minimum to be eye pleasant) regardless of the screen resolution or portrait/landscape mode. That was the harder work, since adapting the spacing between items involves emulate something like responsive design of web pages. In that work, the most difficult actor(hehe) was Clutter, since in Clutter, you don’t know the size of the screen or the screen rotation until it is allocating its elements. BUT, I need to do some calculations (number of pages, spacing, etc) before that, since I can’t tell clutter how many space I need or how many “pages indicators” I need before knowing how many space I have to do that. So I was forced to emulate two steps, first, when clutter allocates the most external element, hang its allocation (and therefore its children allocation), calculate everything with the size clutter give me in the most external parent allocation, and then let clutter allocate everything.

-The second work was make the collection view as we have at mockups. One of the work was fixing some bugs we have before, like the side of the arrow calculation, the popup position(was wrong at different screen resolutions or screen rotation), and lot more bugs I found.

Then, when it was ready I start to make the grid inside collection view equal and aligned to the main grid. That was also a hard work, since we are fighting inside a clutter allocation for what I told before, I had to do some tricks to make that works, making a lot of communication between elements of the views and establishing some calculations that will work for every view.

After that, a fun work was to do the expanding collection view, making the elements in the main grid pan to let space to the collection view. That not was that hard, but I know there are a bunch of cases, and sure I forgot some of them, and probably some bugs are there. But for the most part it works! i.e. I tested different resolutions, different folder positions, different number of folder elements, portrait/landscape mode, and a large etcetera.

Then in the last days I was working hard on do that works for every resolution etc, I found some visual errors, due to the main problem I have, I’m doing calculations of ui elements inside a clutter allocation. So this week I was fitgthing with visual glitches of bad volumes in clutter. Finally I get rid of them (thanks Ebassi and Drago01)

And finally I rework the elements visual, making the apps icons looks better (thanks Aday for the advice)

After all, I’m having a lot of fun, and I have to thanks my mentor Florian, who is here in each step I do (and most of them stupid steps from a beginner like me =) ), Allan to give me this opportunity working for gnome and, of course, for his work (and the most important thing for me, its kindness), which get me fascinated and my soul was forced to contribute to gnome to make his mock-ups a reality (really, you was who makes me start contributing gnome!) , Jakub for his advice and really awesome work with blender(I love that program!) and his mockups for pagination and, of course, Emanuelle, to be the ClutterMan who helps me when I’m lost (in clutter and other things!) and Drago for his help also with clutter.

Finally, the work to be done is to get rid of those bugs of screen resolutions, scalate icons to make enough space to put 4 rows in small resolutions, make the code beautiful (a big clean up), make the transitions that are not still implemented and are present on the mockups, do another round with design team, and a big bug testing and fixing.

Also, the work I see would be good to have is for example, make the transition of “expand” of collection views some kind of widget. I had to do all of this manually, calculating manually all of the sizes, etc. It would be good if we have some kind of widget which expands to make space to other elements, which probably can add random ui elements, etc. and don’t do that work each time we want something like this for example in Photos or Music application or other parts of Gnome shell.

Also, it would be good if Clutter allow more this kind of workflow, allowing show/hide actors at allocation, or do some calculations before allocation(like 2 steps allocation) without overriding some item allocate function . (Emannuelle has already something for the show/hide at allocation issue)

See you next time! Hope you enjoy my work!

I’ve been accepted at GSOC 2013!

Hi,

I’m Carlos Soriano, student and worker of Universitat de Girona, in Spain. I’ve been interested in gnome since a year and a half ago and start to contributing since that time. I’ve fixed some easy bugs, made an extension, and made a tutorial on gnome wiki to make extensions. I’m interested on make gnome easier both for very begginer users and for advanced users and also for contributors.

My gsoc project is Redesing of the app picker with the great mentor Florian Müllner. You can see more information at: https://live.gnome.org/SummerOfCode2013/Projects/CarlosSoriano_RedesignGnomeShellAppPicker

I think this will be a great summer and  a great opportunity to learn gnome 🙂