[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Transparency -- take 2
From:       Antonio Larrosa <antlarr () arrakis ! es>
Date:       1999-10-01 21:56:50
[Download RAW message or body]

Geert Jansen wrote:
> 
> Hi!
> 
> Maybe this is not the perfect timing with the CORBA thread going on but I'll
> try it anyways... Maybe this will give you a little diversion from all the
> heavy stuff :)
> 
> I want to implement pseudo transparency for KDE apps. I discussed this
> before on the list. The outcome was that real transparecy is not possible
> (QWidget::setMask is very slow with complex shapes and doesn't allow effects).
> 
> On the contrary, pseudo transparency is rather easy: do a
> QWidget::setBackgroundPixmap() with a pixmap that contains the correct part
> of the desktop background and you're there.
> 
> The part that is not obvious is how to get a background pixmap. The current
> solution is (used by konsole) to read the desktop configfile and render a
> pixmap on your own.
> 
> I don't like this way. A better way (IMO) would be: kdesktop renders the
> backgroup (like it is doing now). It writes it to the root window's
> background and keeps it. It then publishes the pixmap ID to a property on
> the root window. The clients read this property and do a XCopyArea() to a
> QPixmap's handle(). A special class ("KBackgroundPixmap") will be provided
> for the latter.
> 

This was intended and the current solution can be easily adapted to read
this
pixmap from the root window properties instead of generating it itself
just
by changing a pair of functions. Consider this instead of rewriting the
whole
classes please.

> Some advantages:
> * Reduced code duplication (kpager, konsole, kdesktop)
> * The possibility to use "background painting" programs with transparent
>   windows. Maybe we could include xglobe or xearth as a standard option in
>   kdmdisplay. Cool screenshots !
> * Easy "transparent" windows.

Currently you just have to use the class RootPixmap (defined in
rootBg.h)
and set a call to RootPixmap::setBackgroundPixmap(yourwidget); not much
more.
You just have to change the function loadWallpaper to load it from
the root propierties instead of from disk.

The major changes should be done to kdesktop, which is a thing I won't
talk about as there are others who know much more than me about it.

> 
> At the end of this mail, I included some class prototypes of how I think
> this problem should be tackled. I also commented on where I think they
> should go. Please comment!!
> 
> BTW: If we decide we want to do this, I cannot garantee that it will be done
>      before the KRASH freeze. If not, we have to do this after KRASH.

Reuse what's already written :-)

> BTW2: Cristian: were you working on this too?
> 

I was working on it, but had some exams, stopped, and now I'm working on
other things.

Greetings,

--
Antonio Larrosa Jimenez
Student of Mathematics
antlarr@arrakis.es        larrosa@kde.org
http://www.arrakis.es/~rlarrosa
Klein bottles for rent -- inquire within.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic