From kde-devel Sun Feb 21 19:42:01 1999 From: "Yannai A. Gonczarowski" Date: Sun, 21 Feb 1999 19:42:01 +0000 To: kde-devel Subject: Re: [PATCH] Transparency support and bugfixes X-MARC-Message: https://marc.info/?l=kde-devel&m=91962614614307 Haven't checked it yet, but this is something I have been waiting for for a long time. Can someone with CVS access check this out and if he/she decides this is okay, commit? Geert Jansen wrote: > > ==> Transparency support and bugfixes <== > > Dear KDE developers, > > appended to this message is a patch that allows KDE programs to emulate > transparent windows in a not too resource intensive and easy way. It also > contains some bugfixes for kcmdisplay and kbgndwm. > > Why? > > Just for fun. Also, because there seems to be increasing demand for > attractive desktops and transparent windows can IMHO contribute to that. > Modern machines with much memory can easily handle it while it is per > default disabled to be suitable for low-end machines. > > How? > > The only functionality needed to emulate transparent windows is that a (KDE) > program can access a Pixmap of the desktop background. Before I came up with > the final design, I tried a couple of things, they all failed: > > * The application cannot access qApp->desktop()->getBackgroundPixmap() > because this is not set by the application (but by kbgndwm). > * You cannot bitBlt() from qApp->desktop() because this will give to icons + > windows. > * You _could_ read the destoprc files and render the background yourself. > I think this is extremely ugly and I didn't want to add the rendering code > another time (it already exists three times: in kbgndwm, kcmdisplay and > in kpager). > > The thing I did is modify kbgndwm so that it exports the desktop as a .ppm > file to ~/.kde/share/apps/kbgndwm/desktop_x.ppm. I chose .ppm because Qt seems > not to handle >256 color xpms. Another approach could be to store the > backgrounds in shared memory. I didn't do this because I wanted to keep this > first patch simple and also because the QPixmap class does not let you save > to memory (loading yes, but saving, no). > > Implementation: > > * I changed kbgndwm to export the desktop as a pixmap. Both one desktop and > multiple desktop modes are supported. The default for this is off. It must > be enabled first in kcmdisplay. I also made sure that when the setting is > off, there is absolutely no penalty for having this code in there. > * I added a member to KApplication, KApplication::getDTBackground. This keeps > a per program copy of the background pixmap and takes care of the new > KDEChangeBackground client message I added. > * I added the member function KPixmap::loadDTBackground. This loads the > desktop background of a widget and can apply effects such as transparency > and transluency to that. > * I changed kwm (1 line) so that it sends a KDEChangeBackground message to > a window that is being transported to another desktop. > * I added a new file to kdecore, kipc.{cpp,h}. I noticed that the "send a > KDE message" functionality was impelemented 4 times in kcmdispay, of those > twice in one file so I thought it was a good idea to have this in kdecore. > * I updated kcmdisplay to allow GUI configuration (one checkbox :) of the > backgound exports. > > I also fixed some bugs in kcmdisplay/kbgndwm, please see the changelogs for > that. > > I attached the patches to this email: kdecore-diff and kdebase-diff. I also > added a very simple test programme, trans.cpp. > > Please let me know what you think of this patch! Could it be applied to the > new development branch? > > Thanks, > Geert Jansen > > -- > Geert Jansen, email: > Phylosopher and Physicist PGP key ID: 0xD2B5E7CE > > ---------------------------------------------------------------------------- > > Name: kde-trans.tar.gz > kde-trans.tar.gz Type: Unix Tape Archive (application/x-tar) > Encoding: base64 > Description: Patch and test program -- Regards, Yannai. ---------------------------------------------------------------------- Yannai A. Gonczarowski _____..---======~~~~~=======---.._____ ______________________ __,-='=====____ ================ _____=====`= (._____________________I__) - _-=_/ `--------=+=-------' / /__...---===='---+---_' System Administrator '------'---.___ - _ = _.-' yannaigo@leyada.jlm.k12.il `--------' The Hebrew University High School "Si vis pacem, para bellum" http://www.leyada.jlm.k12.il/~yannaigo/ ----------------------------------------------------------------------