== Dev Week -- Fixing small bugs in Unity -- Trevinho and andyrock -- Wed, Feb 1st, 2012 == {{{#!irc [21:01] Hello all [21:01] hey all! :) [21:01] To begin let's introduce ourselves... [21:01] We were two Unity Community hackers [21:02] that after hacking on the unity and nux code get contracted by Canonical [21:02] to develop unity for 12.04 [21:03] Now we're working on bug fixing [21:04] This describes our work, anyway we're two Italian guys... That's why we're often called "The Italians" on our team [21:04] and to implement small features [21:06] We're getting here thanks to the work that we started as community guys, lead by the passion on the free software development [21:09] So as by description, this session is about Unity and after bug fixing in Unity [21:09] First of all... [21:09] Why contributing to unity? [21:10] Well... The first reason can be simple... As it's a quite new software with a very important role and as every software is not bug free [21:11] so... We need to squash them out [21:11] to make unity and so the main ubuntu interface to rock [21:11] Then personally, you can enjoy to work on a big piece of software [21:12] that will be used by millions of users [21:12] From my point of the view, contributing to unity (and open source software in general) can be an opportunity to learn a lot of cool stuff [21:13] Also... If unity doesn't fill exactly to your needs maybe you can work on it to improve it.. That's the main reason I joined at the beginning [21:14] instead of criticizing without doing anything :) [21:16] Or finally, you can just join the development to be welcomed by Jorge in a such way, once you're at the UDS: http://www.flickr.com/photos/trevi55/5701699276/in/photostream [21:16] ;) [21:17] Ok... I think you got what we meant... [21:18] By the way if you're here, maybe the main thing you want is start doing something for our beautiful shell [21:18] So... Let's start [21:19] First of all... Talking about unity we talk about an (united) ecosystem... So Unity is just one of the projects that makes the "unity experience" possible [21:19] The main launchpad branches you should start to branch and look are [21:19] lp:bamf - for the Windows /applications matching and management [21:20] lp:nux as the widget library [21:20] lp:libunity [21:20] and then [21:20] nava asked: what basics we should know to help in unity project (i mean programming language) ? [21:20] lp:unity [21:20] nava, basic c++ [21:21] Yes, nux and untiy are in C++ [21:21] while bamf is in C and libunity in Vala [21:22] autopilot in pythong [21:22] So, I was listing the projects... lp:unity is anyway the "core" of our shell... Basically is a compiz plugin that gets loaded when compiz runs, but to do many patches this shouldn't worry you [21:22] without the g :) [21:23] So.. To get started on development, first of all, we suggest to always stay up-dated to the last ubuntu version [21:23] *development version* [21:23] so precise, now [21:24] Then, to install the main dependencies you can use the unity-team staging ppa [21:24] that is at https://launchpad.net/~unity-team/+archive/staging [21:24] and you can get the needed dependencies by doing something like [21:24] sudo apt-get build-dep unity [21:24] keep in mind the staging ppa can break your pc :) [21:24] yes, that's the coolest part :) [21:25] most of the time, you'll need to play with nux [21:25] so it can be useful [21:25] sudo apt-get build-dep nux [21:26] btw to build unity from trunk read here http://askubuntu.com/questions/28470/how-do-i-build-unity-from-source [21:27] now that we know how to build unity, let's talk about what bugs we can solve :) [21:27] Now... If you want to start, you'd maybe remember the famous "bitesize list"... Well that's still valid and you can check it at https://bugs.launchpad.net/unity/+bugs?field.tag=bitesize [21:27] But if you want to be really useful you can fix the "backlog bugs" [21:28] https://bugs.launchpad.net/unity/+bugs?field.tag=backlog [21:28] All these bugs are also listed in this more useful page: http://people.canonical.com/~platform/design/upstream.html [21:28] that shows the bugs that have more design priority [21:29] A bitesize bug is a really simple to solve bug (or at least is should be easy to solve) [21:29] Let's talk about the backlog bugs [21:30] What is a backlog bug? [21:30] You can also subscribe to the unity bugs at https://bugs.launchpad.net/unity [21:31] A backlog is a feature that needs to be implemented [21:31] a feature or an improvement to a feature [21:32] as you can see we have a quite long backlog list :/ [21:33] So the first step is: "Decide what bug do you want do solve" [21:33] Once you've decided... You just need to branch unity (or the project you want to fix) [21:33] So for example, considering unity [21:33] just do [21:34] bzr branch lp:unity [21:34] then [21:34] cd unity [21:34] mkdir build [21:34] cd build [21:34] cmake .. -DCMAKE_BUILD_TYPE=Debug -DCOMPIZ_PLUGIN_INSTALL_TYPE=local -DCMAKE_INSTALL_PREFIX=/usr [21:34] this will configure your branch to be compiled [21:34] ensuring that you've all the dependencies needed [21:34] At this point the hardest thing begings [21:35] that's coding your feature [21:35] now... If you need some documentations for the libraries we mostly use [21:35] you can go to http://developer.ubuntu.com/resources/platform/api/ [21:38] So let's say we want to fix this bug [21:38] he document that andyrock just linked is another useful tool you can use to understand how unity is made [21:39] sorry :) [21:39] http://www.google.it/url?sa=t&rct=j&q=alt%20%2B%20f4%20dash&source=web&cd=1&ved=0CCsQFjAA&url=https%3A%2F%2Fbugs.launchpad.net%2Fbugs%2F891818&ei=6LApT52gI8jc4QSr_bzYAw&usg=AFQjCNFLgM3TIF4Q5cR-2yTt7uWI_6rxgw&sig2=3e3RioCBKXjA-b4MgZFDxA [21:39] sorry again :) [21:40] https://bugs.launchpad.net/bugs/891818 [21:40] Dash - dash is not closed with alt+f4 [21:41] The first thing to do so is to study [21:41] and the first question is: "What is the best way to solve this bug" [21:42] Maybe we can just intercept the alt+f4 key and the close the dash [21:42] but there is a best way... [21:43] intercept a WM_DELETE_WINDOW message [21:44] that is send from the windows manager when you press alt+f4 [21:44] You can get this by using xev for example [21:44] an useful tool to understand what's going on an X window... [21:44] if you run it on a terminal and you do Alt+F4 [21:44] Why this is the best wat to do this? [21:45] you get an output: [21:45] ClientMessage event, serial 36, synthetic YES, window 0x6400001, [21:45] message_type 0x13a (WM_PROTOCOLS), format 32, message 0x138 (WM_DELETE_WINDOW) [21:45] Why this is the best wat to do this? [21:45] because it's easy to test [21:46] and because if you change the key binding to close a window [21:46] the code will continue to work :) [21:46] kedde asked: Is it possible to set up a breakpoint in an IDE? [21:47] kedde, yes, but you need to do it using gdb [21:47] from another tty [21:47] so alt+ctrl+f1 [21:47] login [21:47] then [21:48] DISPLAY=:0 unity --advanced-debug [21:48] or [21:48] DISPLAY=:0 gdb --args compiz --replace [21:49] Let's return to our bug... [21:50] There are 10 minutes remaining in the current session. [21:50] so what we want to do is to intercepet that event [21:51] you should know that the dash has an associated X window [21:51] so we'll use that window to receive the event [21:52] but we have a little problem :) [21:52] we should add the support in nux [21:52] to send the event to unity [21:54] and this is the tricky part of this bug :) [21:54] Now've not the time to go into the details [21:55] There are 5 minutes remaining in the current session. [21:55] Yes.. Anyway in that case basically you need to make nux get that event and to emit to a BaseWindow [21:55] then on the Unity side you only have to connect to that event and close the window [21:55] Now, in Precise we're also focusing a lot on testing [21:56] and on quality [21:56] so, tetsing can be another way to contribute to the project [21:56] We have many ways to test... [21:56] Google test for example [21:56] http://code.google.com/p/googletest/ [21:56] They mostly depends on what you should test [21:57] so, we use google test when we have to just check a data structure, for example [21:57] or we use Autopilot https://wiki.ubuntu.com/Unity/QA/Autopilot to autogically move unity and check if it's doing the right thing [21:57] Give a look to Autopilot, it could be fun to test with it [21:58] So, we slightly shown the process we generally follow when doing something for unity [21:58] what we can say is that it's not that hard [21:59] if you know a little the language and you can use grep, you can just start to scratch your itches from now [21:59] fixing the bugs the most are breaking your head [21:59] Just branch unity, and have fun [22:00] Logs for this session will be available at http://irclogs.ubuntu.com/2012/02/01/%23ubuntu-classroom.html [22:00] If you want, you can also check to our branches to see how to do things https://code.launchpad.net/~3v1n0/unity and https://code.launchpad.net/~andyrock/unity [22:00] thank you guys [22:01] Thank you all [22:01] Hope to see your code in launchpad, and to review it! ;) }}}