5

I am trying to create an overlay window above another running application. Let's say firefox. I implemented by using Xcreatewindow

win = XCreateWindow( display, *firefoxwindow,
                   50, 300, 400, 400,
                   0,
                   visualinfo.depth,
                   InputOutput,
                   visualinfo.visual,
                   CWColormap|CWEventMask|CWBackPixmap|CWBorderPixel,
                   &attr
                   ) ;

I searched *firefoxwindow by using XQueryTree()

and then followed this code https://gist.github.com/903479

The result is the transparent window when I use the XRoot as parent. But, when I try to use firefoxwindow or other application window as parent, it became optique.

gvlasov
  • 18,638
  • 21
  • 74
  • 110
user753758
  • 75
  • 5

1 Answers1

4

In your case you need to composite window pixmap with background window manually. When you create window with root as parent transparency is handled by compositing window manager

Andrey Sidorov
  • 24,905
  • 4
  • 62
  • 75
  • 1
    Would you please guide me a little bit more, I'm quite new to this things. – user753758 May 23 '12 at 09:56
  • 1
    with Composite extension ( http://www.freedesktop.org/wiki/Software/CompositeExt) you can delegate copmositing to external program, which coud, for example treat aplpha channel as a transparency. Very simple compositing manager source: http://cgit.freedesktop.org/xorg/app/xcompmgr/ – Andrey Sidorov May 24 '12 at 03:01
  • Thank you Andrey, one more question, do you think, is possible to run other application on the top of another full screen application? – user753758 May 29 '12 at 12:56
  • 2
    usually full screen app uses just non-framed window (0,0,screen-width, screen-height) - no magic there. You should be able to restack window on top of it – Andrey Sidorov May 30 '12 at 02:20