Branch: master

a4f1031a 2014-11-17 14:31:46 Timothy Pearson
Fix improper desktop wallpaper export causing fake transparency dependent application failure
M kcontrol/background/crossfade.h
M kdesktop/bgmanager.cc
diff --git a/kcontrol/background/crossfade.h b/kcontrol/background/crossfade.h
index dba34a3..da589aa 100644
--- a/kcontrol/background/crossfade.h
+++ b/kcontrol/background/crossfade.h
@@ -31,8 +31,8 @@
     mw = pix1.width();
     mh = pix1.height();
 
-    int alpha = 0xffff * (1-r_alpha);
-    
+    short unsigned int alpha = 0xffff * (1-r_alpha);
+
     XRenderColor clr = { 0, 0, 0, alpha }; 
     XRenderPictureAttributes pa;
     pa.repeat = True;
diff --git a/kdesktop/bgmanager.cc b/kdesktop/bgmanager.cc
index adb25d2..7c641dd 100644
--- a/kdesktop/bgmanager.cc
+++ b/kdesktop/bgmanager.cc
@@ -399,8 +399,9 @@
     // Do we have this or an identical config already running?
     for (unsigned i=0; i<m_Renderer.size(); i++)
     {
-        if (((m_Renderer[i]->hash() == m_Renderer[edesk]->hash()) && (m_Renderer[i]->isActive())) && (desk != 0))
+        if (((m_Renderer[i]->hash() == m_Renderer[edesk]->hash()) && (m_Renderer[i]->isActive())) && (desk != 0)) {
             return;
+        }
     }
 
     renderBackground(edesk);
@@ -665,7 +666,7 @@
                 TQApplication::desktop()->screen()->backgroundPixmap() );
             }
 
-            //TODO Find a way to discover if CrossFade effect needs to run  
+            //TODO Find a way to discover if CrossFade effect needs to run
             if (mOldScreen){
                 crossInit = true;
                 m_crossTimer->start(70);
@@ -685,17 +686,18 @@
             do_cleanup = false;
         }
     }
-    if (m_bExport || !m_bCommon)
+    if (m_bExport || !m_bCommon) {
 	addCache(pm, r->hash(), desk);
-    else
+    }
+    else {
         delete pm;
+    }
 
-    if (current)
-        //exportBackground(desk, realDesktop());
-        exportBackground(desk, desk);
+    if (current) {
+        exportBackground(desk, realDesktop());
+    }
 
-    if( do_cleanup )
-    {
+    if( do_cleanup ) {
         r->saveCacheFile();
         r->cleanup();
     }