Getting the hang of a new gtk+ feature
For some time now gtk+ offers redirecting widgets, so the rendering happens offscreen only. That is a mandatory feature for doing some interesting things with UI-elements. With the source-distribution of gtk+ you get a huge collection of coding-examples. There is also an example for offscreen widget-rendering. Unfortunately this is a very basic and boring example. It does not really demonstrate the additional possibilities now available in gtk+ very well. Since I need to make use of this new feature in gtk+ in the near future, I had to create my own example, which is much closer to the application-need I have.
Here’s a little show-off screencast for your viewing-pleasure…
![]() (click to play back, ogg/theora, ~1.1 MBytes) |
P.S.: Yes, usually I type much faster.

November 28th, 2007 at 10:53 pm
very cool
November 28th, 2007 at 10:57 pm
Funky indeed.
November 28th, 2007 at 11:13 pm
I want it.
November 28th, 2007 at 11:24 pm
Hiya,
Can you explain the difference between "composited child windows"
1) http://bugzilla.gnome.org/show_bug.cgi?id=412882
Which AIUI is letting the application draw its children, and offscreen rendering
2) http://bugzilla.gnome.org/show_bug.cgi?id=318807
Which AIUI is the more efficient way to implement (1), needed for canvas support, and not yet finished. Either that or I am completely beside the point, so please correct me…
John
November 28th, 2007 at 11:25 pm
So if GTK+ has off-screen rendering, is there anything standing in the way of GL-accelerated GTK themes?
November 28th, 2007 at 11:28 pm
Umm, the offscreen rendering patch is neither finished nor included in the main GTK+. Where did you get your "source-distribution of GTK+" that has this in it?
November 28th, 2007 at 11:29 pm
offscreen redirection is not available in gtk+ trunk, but just as a patch that’s neither complete nor heavily tested. I’m pretty sure mirco knows this, but just as heads up for everybody else.
November 28th, 2007 at 11:39 pm
To continue on my comment from above, which approach are you using here?
November 28th, 2007 at 11:55 pm
Nice Work!
What did you plan in the near future
November 29th, 2007 at 12:02 am
Does this work the same way as ‘Widgets on the canvas’ in Qt 4.4 ?
Anyone know the difference between this and the ‘Widgets on the canvas’ project of Qt?
Things like this are possible in Gtk+ too now? http://labs.trolltech.com/blogs/2007/11/22/widgets-on-the-canvas-integrated/
November 29th, 2007 at 12:34 am
Wesley S,
something like this?
http://njpatel.blogspot.com/2007/11/i-think-i-just-found-another-dimention.html
November 29th, 2007 at 12:44 am
Erm, where’s the code?
November 29th, 2007 at 5:51 am
Where can I get that wallpaper?
November 29th, 2007 at 6:04 am
humina humina humina - nice work dude
November 29th, 2007 at 8:56 am
That is just with the drawing redirection part of the offscreen patch.
With the full patch you get input redirection for transformed widgets too.
Check out this screencast i did three years ago when working on the offscreen patch:
http://people.redhat.com/alexl/files/offscreen3.html
November 29th, 2007 at 9:56 am
@ Carl: Hm… not without a lot of work. Right now the best approach available to use would be sticking this into clutter & Co (demonstrated by Neil J. Patel some weeks ago).
@ iain: I use gdk_window_set_composited().
@ Emmanuele B.: Indeed it’s not the full deal yet, but it’s close.
@ john: The one from http://bugzilla.gnome.org/show_bug.cgi?id=412882
@ Paula: Fun things as always.
@ Wesley S.: No that’s not easily possible yet. But it’s part of the solution to get something like that working.
@ Alberto R.: Patience my friend… it will come.
@ Munchkinguy: That’s https://wiki.ubuntu.com/Artwork/Incoming/OranSun
@ Glynn F.: Thanks man!
@ Alexander L.: Indeed I have not looked into input-redirection yet. That stuff is three years old already… whee
BTW, I’m a bit confused about your and Ryan "desrt" Lortie’s work regarding the whole offscreen/redirection in gtk+. Who did what now?
November 29th, 2007 at 10:37 am
nice and cool, but pretty useless
November 29th, 2007 at 10:53 am
MacSlow:
desrt did the gdk_window_set_composited() stuff. My code is different and doesn’t use XComposite, instead it basically just wraps all Gdk drawing ops and redirects them.
The offscreen patch is at:
http://bugzilla.gnome.org/show_bug.cgi?id=318807
November 29th, 2007 at 4:45 pm
This is really cool! I hope we can get some more (useful) bling to GNOME in the future. Not fully sure yet where it could be useful…
November 29th, 2007 at 6:01 pm
@ Johannes: It’s not really about the bling, but the things possible now that we’re able to redirect widget-rendering offscreen. You’ll see what I mean sooner or later
November 30th, 2007 at 7:45 pm
GTK+ web 2.0 style… just LOL
December 21st, 2007 at 5:52 am
Excellent!
February 6th, 2008 at 12:06 am
Can this de done with pygtk and cairo? and if so can someone please do it and post it…