Published 2011-04-25 00:00:00

Well, as Gnome 3 is out, it has to be tested. Luckily I've not got a huge deployment to sort out, but as I have a few applications that use Gtk, I thought it was about time I upgraded one of my machines to see what chaos I will have to deal with in the future.

So it was one of my Ubuntu boxes that got the pleasure of a Natty and Gnome3 PPA upgrade. (I use debian on my other development box, which actually got destroyed last week with a complete disk failure, although I suspect the motherboard may have problems... It's getting old like me...)

Upgrading to Natty is not to bad, from what I remember it only took a small amount of brain surgery to get it to boot correctly after the upgrade. But once up, you get the pleasure of the Unity desktop. My first impressions where not to hot on unity, my wife uses it on her netbook, it's great there, after the initial shock of me upgrading without her knowing, she actually said it was alot better than compiz. Although she missed the special effects.

But after using Unity on the big screens, it just became unbearable. Detached menus may seem like a cool idea, and are quite handy on a netbook, but they are an absolute nightmare when using things like gimp on dual head full HD monitors, my wrists hurt after a few minutes.... 

Along with the removal of the Applications/Places/System menu's which while klunky are still handy for quickly finding applications. A classic example of this Alleyoop Memory Checker, a very nice wrapper around valgrind. In the Unity world if you do not know the name of the application, then finding it is a huge mouse journey around big icons. 

As for the left icon menu, all I can say is that I'm not the worlds best designer (although at least I did study it), but it's so graphically noisy that it unusable. It's basically a bad re-invention of Docky/Cairo Dock, which do far better jobs at providing a similar task role. 

So after all that I did try and get gnome-shell going, but unfortunatly the Gnome3 PPA build is not currrently working, and also has a rather nasty habit removing all usable desktop enviroments. I ended up adding xterm to one of the /etc/Xorg/X.sessiond files and starting up gnome-panel, mutter and docky to produce a usable desktop for the time being, while I wait to test out the latest gnome-shell.

So on with the harder stuff.. - Gtk3 and introspection.

One of the key applications I use to develop is app.Builder.js , it's a drag/drop interface to build web applications, that also allows you to fill in all the code and associate it clearly with the element and event occuring. It's written in Javascript, and uses Gnome seed to run on the desktop. As I've mentioned before Seed is a bridge layer between the Webkit Javascript engine, and Gobject-introspection, the now standard way to interface Gnome/Gtk/Glib etc. projects to non-C languages, eg. Python, Javascript (and others...)

With the introduction of Gtk3, GObject introspection has also been updated, and the updated mix between the two had quite a few knock on effects to the builder I had written using Gtk2 and pre-0.9 versions of Gobject introspections. Heres a general summary of the changes.

TreeIter and TextIter 

The latest version of GObject introspection has a feature called caller allocates, this basically means that previously with Seed we had to create an instance of a TreeIter, the the TreeIter call would be of type 'inout' (eg. the Iter would be sent into the method, and returned out)

var iter = new Gtk.TreeIter();
model.get_iter_from_string(iter, path);
// iter would now contain the tree iter for that path..

In newer versions, the iter is an 'out' value, which means you have to create an object for the iter to be added to. eg.
var iret = {};
model.get_iter_from_string(iret, path);
// iret.iter now contains the tree iter.


since the get_selected method for a GtkTreeSelection now has 2 out values, the call has change from

var iter = new Gtk.TreeIter();
selection.get_selected(model, iter);

var sret = {};
// sret now contains { model: **THE MODEL**, iter: **THE ITER** }

TreeModel get_value

Since get_value does not have a return value, seed with return the 'out' values as the return object.

var value = new GObject.Value('');
model.get_value(iter, 2, value);

var str = model.get_value(iter, 2).value.get_string();

Drag pixmap becomes surfaces

This is a pure Gtk3 API change (BC break)

var pix = widget.create_row_drag_icon ( path);
Gtk.drag_set_icon_pixmap (ctx, pix.get_colormap(),   pix,  null, ..... )

var pix = widget.create_row_drag_icon ( path);
Gtk.drag_set_icon_surface(ctx, pix);

Drag drop data passing..

The drag drop signals appear to work ok, however I've not managed to get the data to go back and forth, 
a quick workaround is to just use some form of global variable to store the current dragged item (I doubt you will get more than one dragged item at once..)

Drag drop API

alot of these appear to have played musical chairs.
GtkWidget.prototype.drag_source_set -> Gtk.drag_source_set
Gtk.drag_source_set_target_list -> GtkWidget.prototype.drag_source_set_target_list
Gtk.drag_dest_set -> GtkWidget.prototype.drag_dest_set

Internal Seed changes

I've added a few more fixes to Seed in the last few weeks, mostly to handle compiling correctly and detecting the correct version of introspection. for the most part it's working fine, however I'm still a bit baffled by a Glib memory corruption bug, which occured after multiple model.set_value and model.get_value calls. After running valgrind, I managed to stop the corruption occuring by increasing the allocated size for a struct by 1 byte 
Around line 546 and 640 of seed-engine.c the change goes something like this.
-                  out_args[n_out_args].v_pointer = g_malloc0 (size);
+                  out_args[n_out_args].v_pointer = g_malloc0 (size+ 1);

Arround line 738 of seed-structs.c  
-  object = g_slice_alloc0 (size);
+  object = g_slice_alloc0 (size +1);


"It's basically a bad re-invention of Docky/Cairo Dock"

Not too surprising, considering Canonical grabbed the lead developer of Docky. He had to give up working on Docky since it was so similar and didn't want to raise suspicions that he was using their dime to fund Docky. ;-)
#0 - Chris ( Link) on 2011-04-25 17:23:38 Delete Comment
I am little bit surprise when read this Gtk3 introspection updates,because Gtk3 is is the application where we use in recommended service. I hope this new updates will help us to save time.
Top Universities that Welcome International Students for Creative Writing
In the present day, the number of international students is increasing every year. Students love to study in a foreign country and many students dream of studying abroad when they are very young. It is possible for students who are dreaming of studying abroad since more and more universities, colleges and schools across the world welcomes international students. If you look at the classrooms of universities, colleges and schools across the world you will be able to find out a number of students who are from out of country. Diversity is not only seen in public life but also in the classroom and it is always a great thing to have diversity in classroom as it enhances learning.

visit here :
#2 - buy essays ( Link) on 2018-01-31 13:21:03 Delete Comment
nice work
#3 - Jack William ( Link) on 2018-03-04 17:07:41 Delete Comment
nice work by you.
#4 - Jack William ( Link) on 2018-03-04 17:11:23 Delete Comment
About next generation
There are many debates and contribution in developing this platform through sharing their skill and knowledge regarding the Gtk3.The is also moving towards the improvement of the environment.Could you please let us know about the next generation of this version?
#5 - Doughlash ( Link) on 2018-04-19 17:59:10 Delete Comment
About next generation
There are many debates and contribution in developing this platform through sharing their skill and knowledge regarding the Gtk3.The is also moving towards the improvement of the environment.Could you please let us know about the next generation of this version?
#6 - Doughlash ( Link) on 2018-04-19 18:01:22 Delete Comment
Now look like unenviable may be after some time this will change for you.
#7 - Mike ( Link) on 2018-05-06 16:39:04 Delete Comment
good info
nice post. good effort on your part. plz keep posting.
#8 - gobowlingalley ( Link) on 2018-05-27 14:18:40 Delete Comment

Add Your Comment

Follow us on