On 11/03/14,Albrecht Schlosser wrote:
> Do we need to check this, or does the code below work anyway, because
> the window manager will ignore the request?
No need to check for this; WM will ignore it anyway and composite
manager will pick it up when is running.
> > setting
> > transparency should not be that hard: just set window property using
> > _NET_WM_WINDOW_OPACITY atom with opacity level.
> >
> > Here is a snipet from EDE:
> >
> > ...
> > Atom atom = XInternAtom(fl_display, "_NET_WM_WINDOW_OPACITY",
> > False); uint opacity = 0xc0000000;
> > XChangeProperty(fl_display, fl_xid(window),
> > atom, XA_CARDINAL, 32, PropModeReplace,
> > (unsigned char*)&opacity, 1L);
> > ...
> >
> > where 'window' is Fl_Window or Fl_Double_Window object.
>
> Yes, this doesn't look very complicated.
>
> Do you know what the value 0xc0000000 is? Is this the alpha value?
> How is it calculated? Looks like 75%, maybe...
You can calculate the value like this:
0.80 * 0xffffffff = the window is 80% opaque (or 20% transparent)
but general guideline is that transparency range is 0 - 0xffffffff
(where 0 is fully transparent).
> Thanks for the code. I g****ed for docs, but could only find
> "proposols" and similar. Do you have a link?
Gah, that is the problem with freedesktop community: things got
implemented without notice. The best document is to check gtk source
(gdkwindow-x11.c), demos like
https://gist.github.com/chjj/1342484 or
to dig inside composite manager code, like for xcompmgr.
Not sure why this didn't get in official specification.
Also, you might be interested in _NET_WM_OPAQUE_REGION
(
http://standards.freedesktop.org/wm-spec/wm-spec-latest.html) for
setting transparent regions inside window. Gtk is using this under
'gdk_x11_window_set_opaque_region()' function.
Mess, I know...
Best,
Sanel