PDA

View Full Version : Painting over QX11EmbedContainer



grawp
14th May 2011, 11:09
I have a strange problem. In constructor of my MainWindow (just ordinary QWidget) I create some QWidgets (like button, label...), and add them to a grid layout.
Then I create "OSD" QWidget subclass.. something like this: http://www.qtcentre.org/wiki/index.php?title=Widget_Overlay. And at the end of constructor of my MainWindow I do this:

osd = new OSD(this);
It works really nice..

And I have other QWidget subclass "Video" containing QX11EmbedContainer displaying some X11 window. When I add it to the layout of my MainWindow, the OSD just won't paint over the area where "Video" is.
What I'm doing wrong? How can I paint over widget containing QX11EmbedContainer? Is there any other way I can embed X11 windows and paint over it?

wysota
17th May 2011, 22:58
I don't think you can paint over an area that is managed by a different application.

grawp
18th May 2011, 10:08
I don't think you can paint over an area that is managed by a different application.

Well, I've never wanted to paint directly over the area owned by other application. I wanted to paint on transparent widget and then lay it over the app. window (whether embedded or not).
The problem is however that QT transparency is only semi-transparent, double buffered and QT only.

The solution is to update the background of the transparent overlay in every frame, which is very inefficient. http://forum.videolan.org/viewtopic.php?f=32&t=68816

Other solution is http://doc.trolltech.com/4.7/widgets-shapedclock.html. I haven't tried it yet, but it looks very promising. Make the overlay as a shaped X11 window (maybe with transparency) and keep it placed over the wanted area..

Has anybody here ever needed to solve similar problem?

wysota
18th May 2011, 10:23
Well, I've never wanted to paint directly over the area owned by other application. I wanted to paint on transparent widget and then lay it over the app. window (whether embedded or not).
Since the widget is transparent, you'd need to draw the background first that is residing in the other application. And since you can't do that, you'll get an empty (black) background. That's how the backingstore works.