Posts tagged with ‘opensource’
Contributing to Krita
kinow @ Jan 03, 2017 11:40:03Tweet
As I mentioned in the last post, I have been learning Qt and using C and C++ again. Since I used C and C++ more during university (about 10 years ago, phew), decided to read real code.
I used Photoshop, Illustrator, and Fireworks a lot when I was younger and had more time to spend drawing. But some time ago I switched to Inkscape for vector graphics, which I use at work for presentations. So it was only natural to try Krita now.
Since I was going to try Krita, I thought why not check out and build from source, and then in case I found any bugs, contribute back? Or maybe from time to time triage issues, find low hanging ones, and send a patch?
Well, turns out the Krita project has a great community, and it is super easy to send contributions. So far I submitted three patches, some were included in 3.x releases.
While the patches are rather small, they are suggestions on how to fix memory segmentation faults, or strange behaviours in the interface. For these issues, I had to learn more about Qt components, signals and emitting events, and, of course, work with pointers, arrays, Qt data structures, etc. In other words, lots of (geek) fun!
In other words, by contributing to Krita, I am not only helping the project and giving a little back to the community, but also refreshing my memory on C and C++, and slowly learning Qt - which is not very hard if you worked with Swing/AWT, Delphi, Visual Basic, Gtk, etc.
What are you waiting to contribute to Krita? The developers that maintain the project answer tickets and questions posted to reddit in a good time, and are extremely easy to work with.
Debugging an application that freezes the X server
kinow @ Jan 02, 2017 00:39:03Tweet
Some time ago, I decided to start writing C++ again, and picked Krita for that. Krita is written in C++ and Qt. The bug I was working on involved a memory issue when changing the UI.
The problem was that this UI change would result in, not only Krita, but the whole X server freezing. My set up was basically Ubuntu 16.04.1 LTS, with Eclipse, Qt5, and the latest version of Krita checked out via git.
Initially I spent some time looking at the logs, tracing the binary, even downloaded some Qt utility tools to look at the events and what was happening with the application when it froze.
However, eventually I realized I was going to spend more time on this part of the issue, rather than on the memory bug. So decided to look for a work-around.
Thankfully someone else blogged about a similar issue and saved me a lot of time :-) Here’s how I did it, following the instructions in this blog post.
$ sudo apt-get install xnest -y $ cd krita_install/ $ Xnest :10 $ twm -display :10 $ export DISPLAY=:10 $ ./krita
That’s it. You should have Krita running in a separate window, with Xnest, and within this window the twm window manager running. So when it freezes, at least you can still debug your application in Eclipse or whatever IDE you prefer.