22 October 2011

世界初! The trick: gtk2 & gtk3 coexist

GTK+ 2.x and 3.x should be seen as two different libraries.
Of course they are similar, and are source compatible in some level.

Due to the similarity, GTK+ team decided that they can not coexist, and wrote runtime check to make sure that.

There are some tricks and wrappers can do a real "gtk2 & gtk3 coexist", for example you can use a gtk3 web browser and use the gtk2 Adobe flash plugin in it.

Since version 0.5.0, evilvte uses dlopen() to do a "gtk2 & gtk3 coexist".
They do not really coexist in one single window, but you can run one binary to choose gtk2 or gtk3 at runtime like this:

~$ evilvte --2 & evilvte --3 &

Due to the similarity of gtk2 and gtk3, it is quite easy to do the dlopen() trick. I do not think it will be common, but I do hope some others will do the same thing to support two versions of GTK+ at the same time. Maybe not for gtk2 and gtk3, but for gtk3 and gtk4.

I do not think I am the first to do the "choose from 2 libs at runtime", but for gtk2 and gtk3, I think I am really the first in the world. :-P

So I put the Japanese phrase at title, "世界初!", which means "The first in the world!".

evilvte 0.5.0 released

Changelog:
0.5.0

 The "One binary to rule them all!" Release

 * Fix a bug for -e option
 * Fix a bug for input method menu
 * New configure option: --with-gtk=2+3|3+2
   The binary will not link to VTE nor GTK+, thus
   can support GTK+ 2.x and 3.x at the same time.
   It still depends on VTE runtime, of course.
   Use --2 or --3 command line options to choose
   the version of GTK+.
   If evilvte segfaults with --3 option,
   please try export USE_ACCESSIBLE=0 or
   USE_ACCESSIBLE=1.
 * Drop codes with VTE version < 0.17.1

 * How to report bug, request feature,
   or submit patch for evilvte