Hiho,
two weeks ago I resurrected an old thread ("Transparent stage?...")
about how to manage a fully transparent Clutter toplevel window to do
OSD like stuff on a composited X11 desktop. Unfortunately responds were
rare (not to say none ;). I know you guys are busy (for example to
publish the 0.9 release ;), but since this issue gets more important for
me I just give it another try.
The story so far: at that time Emmanuele suggested creating an ARGB
window and use clutter_x11_set_stage_foreign() on it. Since I like to do
this with the Perl bindings and this function is not bound I tried
Gtk2::ClutterEmbed (which internally uses
clutter_x11_set_stage_foreign() to attach the clutter stage to the embed
window). But this didn't work, so I am stucked :(. I googled a lot about
this issue - without success.
Beyond you find my Perl script I use for testing. It definitly creates a
transparent toplevel window (proved with a Cairo painted drawing area)
but the ClutterEmbed insistently rejects any transparentness... ;)
--snip--
#!/usr/bin/perl
use strict;
use Cairo;
use Gtk2 '-init';
use Clutter ':gtk-init';
use Glib qw(TRUE FALSE);
main: {
my $window = Gtk2::Window->new('toplevel');
$window->set_default_size(500, 200);
$window->signal_connect('delete_event', sub { Gtk2->main_quit; });
my $colormap = $window->get_screen->get_rgba_colormap;
$window->set_colormap($colormap) if $colormap;
my $drawable = Gtk2::DrawingArea->new;
$drawable->size(300, 200);
$drawable->signal_connect('expose_event', sub {
my $cr = Gtk2::Gdk::Cairo::Context->create($drawable->window);
$cr->set_source_rgba (1, 1, 1, 0);
$cr->set_operator("source");
$cr->paint;
$cr->rectangle (10, 10, 80, 80);
$cr->set_source_rgba (1, 0, 0, 0.2);
$cr->fill;
FALSE;
});
my $clutter_embed = Gtk2::ClutterEmbed->new;
my $stage = $clutter_embed->get_stage;
$stage->set_color(Clutter::Color->parse('DarkBlue'));
$stage->set_opacity(128);
my $hbox = Gtk2::HBox->new;
$hbox->pack_start($drawable, 0, 1, 0);
$hbox->pack_start($clutter_embed, 1, 1, 0);
$window->add($hbox);
$window->show_all;
Gtk2->main;
}
--snip--
So the obvious question: anybody with an idea? If it's not doable in
Perl, is it possible in C/XS? Any pointers where to start?
Thanks,
Jörn
--
.''`. Jörn Reder <[email protected]>
: :' : http://www.exit1.org/
`. `'
`- Debian GNU/Linux -- The power of freedom
pgpUj5MGAtaKC.pgp
Description: PGP signature
