Subject: Transparency with ParentRelative

From: [email-masked]
Date: Fri, 4 Feb 2000 14:19:03 +0000

Hi All,
	I'm just thinking about transparency and using ParentRelative.  I've
attached a small program that create a transparent window.  You can set
OverrideRedirect on or off.  It works well with OverrideRedirect set to
True but has problems with False (when fvwm manages the window). As an
override redirect window you can change the background of the root
window and run xrefresh and the window becomes transparent again.

When fvwm is managing the window it appears correctly with the root
pixmap aligned properly but it doesn't refresh properly, it seems to
revert to a background pixmap of None.

I think this may be due to the settings of the frame window and the
parent window.  Is this the correct hierarchy?

Root
  tmp_win->frame
    tmp_win->Parent
      tmp_win->client window
    tmp_win->decor_w
      tmp_win->sides[], corners[], buttons[] & title

If this is correct do the frame and Parent windows ever get drawn in and
are they ever visible?  If they are never shown it might make sense to
create them with ParentRelative.  I don't think this would add any extra
resource requirements to fvwm or the server.  The only thing it may
effect is when windows die.  Having the Parent window backgrund set to
None means that if a window you don't get an annoying flash of the
Parent window before fvwm takes the frame away.

Would it be posible for fvwm/add_window.c to do an XGetWindowAttributes
on the client window to see if it wants to be transparent and then do
the appropriate magic?

Cheers,
Tim.

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 4 Feb 2000 16:00:10 +0100

[I've bounced this to the list]

> Hi All,
> 	I'm just thinking about transparency and using ParentRelative.

Just as I started to agree to your previous statements that
transparency using ParentRelative is a hack and doesn't work
well :-)

> I've

Yes.

> are they ever visible?

No, the frame is completely covered by the decor_w and the parent
window is covered by the client window.

> If they are never shown it might make sense to
> create them with ParentRelative.

This is already happening.  I had to do this for the
FvwmTheme transparent option.

> I don't think this would add any extra

This is exactly what I did in FvwmPager with FvwmTheme's
transparency option.  It works well as long as you never
change the background, but then it gets weird.  I think
you have to reapply the background top to bottom to make
the effect visible (i.e. on the root window first, then
the frame, parent, client and finally its subwindows).
Transparency work bad especially with a transient pager
and dragging the viewport with button 3.

BTW, if you start a pager today you'll see a hollow window
for a moment before something is drawn in it because the
client window comes up with ParentRelative.

> on the client window to see if it wants to be transparent and then do

Not necessary.  See above.
--

Overall I find ParentRelative rather useless since it doesn't
react to changes of the background.

Bye

Dominik ^_^

-- 
Dominik Vogt, Agilent Technologies, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/464-4596, fax: 07031/464-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Tim Phipps <[email-masked]>
Date: Fri, 04 Feb 2000 15:56:48 +0000

> [I've bounced this to the list]

Sorry about that I meant it to go to the list but hit the wrong button
> transparency using ParentRelative is a hack and doesn't work
I think I'm changing my mind (or loosing it).  I don't think I'll ever
like transparent terminals but something like FvwmWinList or FvwmIconBox
might be nice on the bottom layer.
> > attached a small program that create a transparent window.  You can set

I didn't but I will with this one. compile with "cc prtest.c -lX11".

> FvwmTheme transparent option.

I must be being dense about how this happens.  I ran "grep -i
parentrelative *.c *.h" in the fvwm directory and got nothing so I
assumed it wasn't happening.

Cheers,
Tim.

#include <stdio.h>
#include <X11/Xlib.h>

main()
{
  Display *dpy;
  int scr;
  Window win;
  XSetWindowAttributes xswa;

  dpy = XOpenDisplay(NULL);
  scr = DefaultScreen(dpy);
  win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 1000, 0, 100, 100, 1,
                            BlackPixel(dpy, scr), WhitePixel(dpy, scr));
  xswa.background_pixmap = ParentRelative;
  xswa.override_redirect = False;
  XChangeWindowAttributes(dpy, win, CWBackPixmap | CWOverrideRedirect, &xswa);
  XMapWindow(dpy, win);
  XSync(dpy, False);
  sleep(600);
}

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 4 Feb 2000 17:27:36 +0100

> assumed it wasn't happening.

I take back everything.  I have to check my code again before
I can make a correct statement :-)

Bye

Dominik ^_^