summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kdm/kfrontend/krootimage.cpp24
-rw-r--r--kwin/kompmgr/kompmgr.c6
2 files changed, 24 insertions, 6 deletions
diff --git a/kdm/kfrontend/krootimage.cpp b/kdm/kfrontend/krootimage.cpp
index a92c6aab1..390601c8d 100644
--- a/kdm/kfrontend/krootimage.cpp
+++ b/kdm/kfrontend/krootimage.cpp
@@ -30,6 +30,7 @@ Boston, MA 02110-1301, USA.
#include "krootimage.h"
#include <X11/Xlib.h>
+#include <X11/Xatom.h>
#include <stdlib.h>
@@ -43,6 +44,8 @@ static KCmdLineOptions options[] = {
KCmdLineLastOption
};
+static Atom prop_root;
+static bool properties_inited = false;
MyApplication::MyApplication( const char *conf )
: KApplication(),
@@ -54,14 +57,28 @@ MyApplication::MyApplication( const char *conf )
renderer.changeWallpaper(); // cannot do it when we're killed, so do it now
timer.start( 60000 );
renderer.start();
+
+ if( !properties_inited ) {
+ prop_root = XInternAtom(qt_xdisplay(), "_XROOTPMAP_ID", False);
+ properties_inited = true;
+ }
}
void
MyApplication::renderDone()
{
- TQT_TQWIDGET(desktop())->setBackgroundPixmap( renderer.pixmap() );
+ // Get the newly drawn pixmap...
+ TQPixmap pm = renderer.pixmap();
+
+ // ...set it to the desktop widget...
+ TQT_TQWIDGET(desktop())->setBackgroundPixmap( pm );
TQT_TQWIDGET(desktop())->tqrepaint( true );
+
+ // ...and export it via Esetroot-style so that composition managers can use it!
+ Pixmap bgPm = pm.handle(); // fetch the actual X handle to it
+ XChangeProperty(qt_xdisplay(), qt_xrootwin(), prop_root, XA_PIXMAP, 32, PropModeReplace, (unsigned char *) &bgPm, 1);
+
renderer.saveCacheFile();
renderer.cleanup();
for (unsigned i=0; i<renderer.numRenderers(); ++i)
@@ -69,10 +86,11 @@ MyApplication::renderDone()
KBackgroundRenderer * r = renderer.renderer(i);
if (r->backgroundMode() == KBackgroundSettings::Program ||
(r->multiWallpaperMode() != KBackgroundSettings::NoMulti &&
- r->multiWallpaperMode() != KBackgroundSettings::NoMultiRandom))
+ r->multiWallpaperMode() != KBackgroundSettings::NoMultiRandom)) {
return;
+ }
}
- quit();
+
}
void
diff --git a/kwin/kompmgr/kompmgr.c b/kwin/kompmgr/kompmgr.c
index 8b6220785..8a7abb94e 100644
--- a/kwin/kompmgr/kompmgr.c
+++ b/kwin/kompmgr/kompmgr.c
@@ -2527,7 +2527,7 @@ usage (char *program)
exit (1);
}
- static void
+static void
give_me_a_name(void)
{
Window w;
@@ -2538,7 +2538,7 @@ give_me_a_name(void)
NULL);
}
- int
+int
main (int argc, char **argv)
{
XEvent ev;
@@ -2562,7 +2562,7 @@ main (int argc, char **argv)
int o;
char *fill_color_name = NULL;
- char **res = NULL;
+ char **res = NULL;
shadowColor.red = 0;
shadowColor.green = 0;