Bug 98734 - KBackgroundInterface.currentWallpaper doesn't return wallpapers past desktop 4
Summary: KBackgroundInterface.currentWallpaper doesn't return wallpapers past desktop 4
Status: CLOSED FIXED
Alias: None
Product: kdesktop
Classification: Miscellaneous
Component: wallpaper (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-07 00:00 UTC by sblinux
Modified: 2009-01-02 20:30 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to allocate all desktops upon startup. (871 bytes, patch)
2005-12-18 04:35 UTC, Kurt Hindenburg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sblinux 2005-02-07 00:00:23 UTC
Version:            (using KDE KDE 3.3.2)
Installed from:    Compiled From Sources
Compiler:          GCC 3.3.4 

I have 6 virtual desktops defined. When I first start KDE, before I change off of the first, I have a SuperKaramba theme that uses PyKDE get the list of wallpapers that are defined for each desktop. For desktops 5 and 6, kdesktop.KBackgroundInterface.currentWallpaper() simply returns the wallpaper of the first desktop instead of the ones that are set there. It returns the correct paths after I have changed to desktops 5 and 6.

How To Reproduce:
Define 5 or more desktops with a different wallpaper on each one.
Exit out of KDE and log back in
Launch kdcop
Browse to kdesktop -> KBackgroundInterface
Execute currentWallpaper(1) then currentWallpaper(5) and compare the results
Change to desktop five and rerun currentWallpaper(5)
Comment 1 Kurt Hindenburg 2005-12-18 04:35:40 UTC
Created attachment 13965 [details]
Patch to allocate all desktops upon startup.
Comment 2 Kurt Hindenburg 2005-12-18 04:36:16 UTC
Any issues with allocating all the desktops at startup?
Comment 3 David Faure 2005-12-18 12:44:57 UTC
On Sunday 18 December 2005 04:36, Kurt V.Hindenburg wrote:
> Any issues with allocating all the desktops at startup?


Slower KDE startup?
Comment 4 Kurt Hindenburg 2005-12-18 23:52:45 UTC
validateDesk is only called for only DCOP calls: currentWallpaper, wallPaperFiles, wallPaperList and setWallpaper so it should not effect performance. I assume .size() is cheaper than numberOfDesktops().

Index: bgmanager.cc
===================================================================
--- bgmanager.cc        (revision 488733)
+++ bgmanager.cc        (working copy)
@@ -577,6 +577,9 @@
 // Return a valid desk number.
 int KBackgroundManager::validateDesk(int desk)
 {
+    if (desk > (int)m_Renderer.size())
+       slotChangeNumberOfDesktops( m_pKwinmodule->numberOfDesktops() );
+
     if ( (desk <= 0) || (desk > (int)m_Renderer.size()) )
         return realDesktop();
Comment 5 Kurt Hindenburg 2006-01-14 16:50:00 UTC
SVN commit 498031 by hindenburg:

Fix initializations for desktops>4 when using DCOP calls.

BUG: 98734


 M  +3 -0      bgmanager.cc  


--- branches/KDE/3.5/kdebase/kdesktop/bgmanager.cc #498030:498031
@@ -577,6 +577,9 @@
 // Return a valid desk number.
 int KBackgroundManager::validateDesk(int desk)
 {
+    if (desk > (int)m_Renderer.size())
+	slotChangeNumberOfDesktops( m_pKwinmodule->numberOfDesktops() );
+
     if ( (desk <= 0) || (desk > (int)m_Renderer.size()) )
         return realDesktop();
 
Comment 6 Tim Beaulen 2006-01-14 18:08:24 UTC
SVN commit 498067 by beaulen:

Forward port fix for bug 98734

CCBUG: 98734



 M  +3 -0      bgmanager.cc  


--- trunk/KDE/kdebase/workspace/kdesktop/bgmanager.cc #498066:498067
@@ -585,6 +585,9 @@
 // Return a valid desk number.
 int KBackgroundManager::validateDesk(int desk)
 {
+    if (desk > (int)m_Renderer.size())
+        slotChangeNumberOfDesktops( m_pKwinmodule->numberOfDesktops() );
+
     if ( (desk <= 0) || (desk > (int)m_Renderer.size()) )
         return realDesktop();
 
Comment 7 FiNeX 2009-01-02 20:30:00 UTC
Bug closed. Kdesktop is no more mantained.