Archive for March 3rd, 2006
Gtkembedmoz/Gecko# for Win32 lives again!
Thats right. Gtkembemoz (or “gtkmozembed” depending on where you look or who you ask) lives again.
It’s been about a year since I got a build going again but I’ve worked out most of the kinks. Screenshots soon…
After I get this release worthy, I’m calling it my last release in this incarnation except to maintain compatibility with newer releases of mozilla/firefox. No big bug fixes with rendering or display issues.
Why, you might ask? Well gtkembedmoz works in Win32 GTK+ because of some amazing hacks. They are some really great hacks though, and I say they are release worthy, however like with many hacks, its a hack, and a hack that goes against the basic assumptions of how things should work. I plan on working on some for fundamental changes lower level inside gecko (inside the gfx layers) that would render almost all of these hacks obsolete. To understand why you have to understand what is really happening underneath.
The hardest part is that the basic assumption with using gtkembedmoz is that you are embedding inside a GTK+ app and the gecko engine that you are embedding is based on GTK+. However on the Win32 version, you are using a GTK+ app but embedding a gecko engine that use the native WinUI based GUI. This cause some really interesting issues.
One of the greatest parts of mozilla code base is that they have abstracted the basic native UIs on all the native OSs they support. WinUI on windows, GTK+ 1 and 2 for Linux, QT (experimental fork) for KDE users, Cocoa for Mac OSX, Mac’s old native gui (pre OS X which is now dead), BeOS (mostly dead), and few others. That means that when you see a text box embedded in a page, its going to be the native one (or nearly the native one based on native elements of your OS) for your OS. This allows mozilla to take some short cuts by using the native facilities provided by the GUI framework instead of having to handle them all on its own in most cases.
However, when embedding gtkembedmoz in Win32, you break the native bounds of each of the GUIs. The biggest bug that you run into is maintaining focus across the UI bounds (why there are so many hacks to fix this). You also run into some issues with embedding plugins (flash, PDF files, quicktime, etc…). Also the themes don’t persist with the native elements. I noticed that my scrollbars don’t match. Not broken or anything but annoying.
The best solution would be to get gecko to use GTK+ as well on Win32. It’s no small task. It means ifdef out all the X11 stuff out for the win32 version of the GTK+ abstraction code and coming up with some alternatives. I’m sure some drawing issues will come up as well, and plugins will have some issues but its far more elegant then trying to hack WinUI together with GTK+.
Also just to have a GTK+ of Firefox on Win32 would be cool.