Bug 77678 - setting kdesktop background mode with dcop?
Summary: setting kdesktop background mode with dcop?
Status: CLOSED FIXED
Alias: None
Product: kdesktop
Classification: Miscellaneous
Component: wallpaper (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: mcamen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-15 17:07 UTC by knweiss
Modified: 2009-01-02 20:27 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to export setColor method via DCOP (2.00 KB, patch)
2004-03-18 11:42 UTC, mcamen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description knweiss 2004-03-15 17:07:53 UTC
Version:            (using KDE KDE 3.1.4)
Installed from:    Unlisted Binary Package

Is it possible to set the kdesktop background mode on the
command line/with dcop? I managed to change the background
wallpaper with the following command:

dcop kdesktop KBackgroundIface setWallpaper wallpaper.jpg 2

Unfortunately, there doesn't seem to be a way to change the BackgroundMode
itself (setBackgroundMode() doesn't seem to be exported; I couldn't
find it with kdcop).

What I would like to do is to change the background mode to Flat (with
a specific color) after disabling the wallpaper with

dcop kdesktop KBackgroundIface setWallpaper "" 0

Is this possible?

My current workaround is to create a small empty color tile and set
this as a wallpaper with the command above. But this isn't very elegant.
Comment 1 Sashmit Bhaduri 2004-03-16 02:02:25 UTC
Note that the role of the wallpaper /mode/ has been severely diminished in KDE 3.2.x
Comment 2 knweiss 2004-03-18 10:36:09 UTC
BTW: xsetroot is no alternative solution because "xsetroot -solid <color>"
can't be used to set a solid background color in a KDE environment. This
is how this problem came up in the first place when we migrated one of
our IRIX users to a Linux+KDE machine.
Comment 3 mcamen 2004-03-18 11:42:55 UTC
Created attachment 5263 [details]
Patch to export setColor method via DCOP

In fact the method to change to color is already there. It just needs one line
to export the method via dcop. With the patch one can use
dcop kdesktop KBackgroundIface setWallpaper "" 0
dcop kdesktop KBackgroundIface setColor "gray" true
dcop kdesktop KBackgroundIface setColor "gray" false
Comment 4 David Faure 2004-03-18 18:17:41 UTC
On Thursday 18 March 2004 11:42, mcamen@mcamen.de wrote:
> Patch to export setColor method via DCOP

Looks fine to me, except that 
+#include <qcolor.h>
could be maybe reduced to
class QColor;

(or does DCOP need the full class definition?)

> In fact the method to change to color is already there. It just needs one line
> to export the method via dcop. With the patch one can use
> dcop kdesktop KBackgroundIface setWallpaper "" 0
> dcop kdesktop KBackgroundIface setColor "gray" true
> dcop kdesktop KBackgroundIface setColor "gray" false
Cool. Please commit.

Comment 5 mcamen 2004-03-18 18:43:42 UTC
Yep, I also tried 'class QColor' first but the full include seems to be necessary for DCOP. I will commit...
Comment 6 mcamen 2004-03-18 18:52:13 UTC
CVS commit by mcamen: 

Add DCOP method for setColor. Now one can set the background color like
this:
  dcop kdesktop KBackgroundIface setWallpaper "" 0
  dcop kdesktop KBackgroundIface setColor "gray" true
  dcop kdesktop KBackgroundIface setColor "gray" false

CCMAIL: 77678-done@bugs.kde.org


  M +6 -0      KBackgroundIface.h   1.10
  M +1 -1      bgmanager.cc   1.86


--- kdebase/kdesktop/KBackgroundIface.h  #1.9:1.10
@@ -7,4 +7,5 @@
 
 #include <dcopobject.h>
+#include <qcolor.h>
 
 class KBackgroundIface : virtual public DCOPObject
@@ -39,4 +40,9 @@ k_dcop:
     virtual void setWallpaper(QString wallpaper, int mode) = 0;
 
+    /** Set color.
+     * @param c The color.
+     * @param isColorA true for foreground and false for background color. */
+    virtual void setColor(const QColor &c, bool isColorA) = 0;
+
     /** Change the wallpaper in "multi mode". */
     virtual void changeWallpaper() = 0;

--- kdebase/kdesktop/bgmanager.cc  #1.85:1.86
@@ -652,4 +652,5 @@ void KBackgroundManager::desktopResized(
 }
 
+// DCOP exported
 void KBackgroundManager::setColor(const QColor & c, bool isColorA)
 {
@@ -674,5 +675,4 @@ void KBackgroundManager::setColor(const 
 }
 
-// DCOP exported
 void KBackgroundManager::setBackgroundEnabled( const bool enable )
 {


Comment 7 FiNeX 2009-01-02 20:27:29 UTC
Bug closed. Kdesktop is no more mantained.