Hi, I played around with gtk transparency a bit. If I add an expose event to the main window in the player and let the engine render the view on the top screen I get a transparent flash player where the desktop is seen through in places where there is no opaque pixels in the flash movie. But if I try to use the GTK widget provided by sfwdec then the widget will render its own background in its own swfdec_gtk_widget_expose routine. The basic thing I would like to do is to modify the swfdec_gtk_widget_expose routine to clear its own background before rendering the flash. In swfdec_gtk_widget_expose: cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); cairo_paint (cr); swfdec_player_render (priv->player, cr); This sequence does what I want if I put it to the expose event of the window created by "gtk_window_new (GTK_WINDOW_TOPLEVEL)". But it does not do what I want when I place it to the expose routine of the gtk widget. I would like to pass the main window expose event to the gtk widget that would then render the flash. But for some reason I only get a very small transparent corner in the widget and the rest of the widget has an opaque background. It is like the sfwdec_gtk_widget would still call some other widget to render itself. And that destroys widget transparency. Any ideas? -- Regards, Karri Kaksonen
Karri Kaksonen wrote:> Hi, > > I played around with gtk transparency a bit. >I continued with my transparency experiments and got together something that suits my needs. I tried to find a place where to post a patch. But the closest place I found was this mailing list. This patch affects the swfdec_gtk_widget object. To gain transparency I have added an EventBox for catching events and changed the widget to draw on its parents window instead of its own window. This should be the same idea as was used on the gtk labels. I also added a flag for removing the decorations in the swfplay executable. The resulting flash movie will now have no borders and lets the desktop show through where there are no flash pixels. Transparency works on Ubuntu 9.04 with a compositing manager running. Regards, Karri Kaksonen -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: transparencypatch Url: http://lists.freedesktop.org/archives/swfdec/attachments/20090902/9d1bbbea/attachment.asc
Hi Karri, Karri Kaksonen ha scritto:> Karri Kaksonen wrote: >> Hi, >> >> I played around with gtk transparency a bit. >> > > I continued with my transparency experiments and got together something > that suits my needs. I tried to find a place where to post a patch. But > the closest place I found was this mailing list. > > This patch affects the swfdec_gtk_widget object. To gain transparency I > have added an EventBox for catching events and changed the widget to > draw on its parents window instead of its own window. This should be the > same idea as was used on the gtk labels. > > I also added a flag for removing the decorations in the swfplay executable. > > The resulting flash movie will now have no borders and lets the desktop > show through where there are no flash pixels. > > Transparency works on Ubuntu 9.04 with a compositing manager running. > > Regards, > > Karri KaksonenJust a style note, diff -up will make the patch a lot more readable. thanks, Riccardo