Can I create a translucent window
I'm using QPixmap.grabWindow to get the contents of an existing X11 App's window (Orig).
I also want to draw my own translucent window over Orig, so that:
- grabWindow still works for Orig, as if it isn't obscured by the visible details in my window
- mouse and keyboard events pass through my window
I understand the concept of an overlay, but the docs only mention QGLwidget being drawn underneath regular widgets. Is it possible to meet my requirements in Qt?
Try "this":http://developer.qt.nokia.com/wiki/QWidget_Semi-transparent_Background_Color for transparent window
Failed to replicate this with qtruby. I'll try with c++ later.
For now I tried drawing the grabWindow pixmap in MyWindow's paintEvent. I then set MyWindow to always-on-top in gnome and tried alternately clicking each window's title-bar while MyWindow was partly covering the original.
Unfortunately this caused recursive garbage. This means the window has to be on top for grabWindow to work. I've heard modern X11 implementations maintain a pixmap of each window in memory but I guess xlib and in turn qt ignore this feature.
When I started the thread I was under the impression there was a way of drawing to an overlay, which I thought could exist above the default screen. I'm going to assume this isn't true.
That leaves raising the original window before I paint mine. So I'm looking for a Qt function which accepts an arbritrary window id and sends a raise event.
mouse and keyboard events pass through my window
- Qt::WA_TransparentForMouseEvents or
2. QWidget::setMask() -> you need to calculate region of MyWindow which can be painted and pass that to setMask function.