View Full Version : KDE 4.1/Plasma gets compiz wallpaper support
onestone
March 16th, 2008, 10:52 PM
Aaron Seigo commited a small change for me to make plasma support the compiz wallpaper plugin indirectly. Indirectly means here that this is not officially supported, but you can make it work:
- you need KDE 4.1 (current trunk revision >= #786352)
- configure the plasma background mode to none (=solid fill with the selected color)
- add/replace the wallpapercolor option in the [Containments][1] group of the .kde(4)/share/config/plasma-appletsrc config file with "wallpapercolor=0,0,0,0"
http://img80.imageshack.us/img80/3535/plasmawallpaperfg8.th.png (http://img80.imageshack.us/my.php?image=plasmawallpaperfg8.png)
Oasisgames
March 17th, 2008, 12:46 AM
All the more reason to implement my enhancement (http://bugs.opencompositing.org/show_bug.cgi?id=831) in the core.
onestone
March 17th, 2008, 12:55 AM
All the more reason to implement my enhancement (http://bugs.opencompositing.org/show_bug.cgi?id=831) in the core.
It is not, because I work on a wallpaper rewrite that will work without this changes.
Oasisgames
March 17th, 2008, 01:01 AM
It is not, because I work on a wallpaper rewrite that will work without this changes.
How so? You know so much about Compiz that I could only dream of figuring out, so how are you going about doing it? The only thing I tried prior to this was wrapping into drawWindow and stealing information from a desktop window, but that fails miserably in things like Expo because it gets the attributes for the previous workspace...
onestone
March 17th, 2008, 01:20 AM
How so? You know so much about Compiz that I could only dream of figuring out, so how are you going about doing it? The only thing I tried prior to this was wrapping into drawWindow and stealing information from a desktop window, but that fails miserably in things like Expo because it gets the attributes for the previous workspace...
You will see ;-)
vertigo1980
March 17th, 2008, 09:58 PM
Nice, very handy :)
Any chance you could do the same for GNOME/Nautilus now? :P
Getting a bit annoyed with GNOME, nothing whatsoever has been done about this upstream after so many requests for so many years. Might switch to KDE, thy might actually listen to their users once in a while
some-guy
March 17th, 2008, 10:08 PM
Look at Packages, FAQs, and Howto, there is a thread there that has existed for quite some time
Deciare
March 17th, 2008, 10:19 PM
Look at Packages, FAQs, and Howto, there is a thread there that has existed for quite some time
But it's not easy like KDE. ;)
I have my doubts about the design decisions that went into the current manifestation of Plasma, but it is so very nice whenever someone decides of act on behalf of the end user. ^_^
some-guy
March 17th, 2008, 10:35 PM
How so? You know so much about Compiz that I could only dream of figuring out, so how are you going about doing it? The only thing I tried prior to this was wrapping into drawWindow and stealing information from a desktop window, but that fails miserably in things like Expo because it gets the attributes for the previous workspace...
there's a reason why his avatar is what it is ;)
vertigo1980
March 18th, 2008, 10:36 PM
Look at Packages, FAQs, and Howto, there is a thread there that has existed for quite some time
Saw that thread and similar ones when they were first posted, and it did work when i tried it. However, it's something that many users want out-of-the-box. Most people wouldn't feel comfortable compiling nautilus. ;)
lol the bug report is almost 7 years old http://bugzilla.gnome.org/show_bug.cgi?id=48004
and they don't even have to support it properly, they should at least allow transparent backgrounds as a workaround (the patch does that), so that compiz can do its thing, while keeping desktop icons.
Oasisgames
March 18th, 2008, 11:24 PM
and they don't even have to support it properly, they should at least allow transparent backgrounds as a workaround (the patch does that), so that compiz can do its thing, while keeping desktop icons.
Actually, the patch forces the background to be transparent when the Compiz_Wallpaper_Supported Atom is enabled, but close enough...
plun
March 19th, 2008, 01:21 PM
Actually, the patch forces the background to be transparent when the Compiz_Wallpaper_Supported Atom is enabled, but close enough...
Well, Gnome will probably sit and discuss this to Gnome 3.0 and no one
uses Gnome...:rolleyes:
Patch 1
diff -Nur eel2-2.19.2/eel/eel-background.c eel2-2.19.2.new/eel/eel-background.c
--- eel2-2.19.2/eel/eel-background.c 2007-04-03 06:06:05.000000000 -0400
+++ eel2-2.19.2.new/eel/eel-background.c 2007-06-05 08:21:06.000000000 -0400
@@ -50,6 +50,8 @@
#include <X11/Xatom.h>
#include <gdk/gdkx.h>
+static GdkAtom compizAtom = 0;
+
/* FIXME: This could really be eliminated now */
typedef struct {
@@ -161,6 +163,9 @@
gulong screen_size_handler;
/* Can we use common pixmap for root window and desktop window */
gboolean use_common_pixmap;
+ /* Should we draw the desktop background transparent (to enable drawing
+ by the composite manager */
+ gboolean transparent_desktop;
};
static void
@@ -986,9 +991,11 @@
gc = gdk_gc_new (pixmap);
eel_background_pre_draw (background, entire_width, entire_height);
- eel_background_draw (background, pixmap, gc,
- 0, 0, 0, 0,
- pixmap_width, pixmap_height);
+ if (!(background->details->is_desktop &&
+ background->details->transparent_desktop))
+ eel_background_draw (background, pixmap, gc,
+ 0, 0, 0, 0,
+ pixmap_width, pixmap_height);
g_object_unref (gc);
background->details->background_pixmap = pixmap;
changed = TRUE;
@@ -1901,11 +1908,55 @@
background->details->use_common_pixmap = FALSE;
}
+static GdkFilterReturn
+compizSupportedFilterFunc (GdkXEvent * xevent,
+ GdkEvent * event,
+ gpointer data)
+{
+ XEvent * e = (XEvent *) xevent;
+ GtkWidget * widget = (GtkWidget *) data;
+
+ if (e->type == PropertyNotify){
+
+
+ if (e->xproperty.atom == gdk_x11_atom_to_xatom(compizAtom)){
+ EelBackground * b = eel_get_widget_background(widget);
+ if (e->xproperty.state == PropertyDelete){
+ b->details->transparent_desktop = 0;
+
+ } else {
+ b->details->transparent_desktop = 1;
+ }
+ eel_widget_background_changed(widget, b);
+ }
+ }
+
+ return GDK_FILTER_CONTINUE;
+}
+
+
void
eel_background_set_desktop (EelBackground *background, GtkWidget *widget, gboolean is_desktop)
{
background->details->is_desktop = is_desktop;
+
+ if (is_desktop){
+ GdkScreen * screen = gtk_widget_get_screen(widget);
+ GdkWindow * root = gdk_screen_get_root_window(screen);
+ if (!compizAtom)
+ compizAtom = gdk_atom_intern("_COMPIZ_WALLPAPER_SUPPORTED", 0);
+
+ gboolean compizSupported =
+ gdk_property_get(root, compizAtom, GDK_NONE, 0, 8, FALSE,
+ 0, 0, 0, 0);
+ background->details->transparent_desktop = compizSupported;
+
+ gdk_window_add_filter(root, compizSupportedFilterFunc, widget);
+ }
+
+
+
if (GTK_WIDGET_REALIZED(widget) && background->details->is_desktop) {
widget_realized_setup (widget, background);
}
Patch 2
diff -Nur nautilus-2.19.2/src/nautilus-desktop-window.c nautilus-2.19.2.new/src/nautilus-desktop-window.c
--- nautilus-2.19.2/src/nautilus-desktop-window.c 2007-04-03 06:08:06.000000000 -0400
+++ nautilus-2.19.2.new/src/nautilus-desktop-window.c 2007-06-03 22:27:34.000000000 -0400
@@ -109,9 +109,16 @@
{
NautilusDesktopWindow *window;
int width_request, height_request;
+ GdkColormap * colormap;
+
width_request = gdk_screen_get_width (screen);
height_request = gdk_screen_get_height (screen);
+
+ colormap = gdk_screen_get_rgba_colormap(screen);
+ if (!colormap)
+ colormap = gdk_screen_get_rgb_colormap(screen);
+
window = NAUTILUS_DESKTOP_WINDOW
(gtk_widget_new (nautilus_desktop_window_get_type(),
@@ -120,6 +127,8 @@
"height_request", height_request,
"screen", screen,
NULL));
+ gtk_widget_set_colormap(window, colormap);
+
/* Special sawmill setting*/
gtk_window_set_wmclass (GTK_WINDOW (window), "desktop_window", "Nautilus");
Is it so difficult to invent something which doesn't need patching ?
b0le
March 19th, 2008, 02:03 PM
Well, to account for every single possiblilty in the future is next too impossible. GNOME was build to work together, so there is no need for anything else to draw wallpaper, so why should it support that?
plun
March 19th, 2008, 02:57 PM
Well, to account for every single possiblilty in the future is next too impossible. GNOME was build to work together, so there is no need for anything else to draw wallpaper, so why should it support that?
Well, as I understands the debate its more about HMI principles not
technical reasons.
A newbie should just have 1 or 2 workspaces and they should look equal.
Now its 4 with a cube and therefore a solution is important.
Not only for eyecandy reasons, also for easy recognition on which workspace a user is.
I don't think Gnome will change... too many dislike Compiz as something which
spoiled an environment.
:)
some-guy
March 19th, 2008, 03:02 PM
If nautilus had built in support for compiz, so that it could handle drawing different images on different sides of the cube, but if the gnome devs can implement the patch for disable drawing, or just allow true transparency, that would be great...
plun
March 19th, 2008, 04:10 PM
If nautilus had built in support for compiz, so that it could handle drawing different images on different sides of the cube, but if the gnome devs can implement the patch for disable drawing, or just allow true transparency, that would be great...
Well...maybe a petition is needed..:D
The only solution without patching I knows is Wallpapoz, but its a "fake" if
the cube is turned on.
http://www.gnomefiles.org/app.php/Wallpapoz
Wallpapoz site seems to be down.
:)
onestone
March 19th, 2008, 06:18 PM
New wallpaper plugin commited. (You will have to update bcop too)
onestone
March 19th, 2008, 06:24 PM
@ALL gnomies: maybe someone should rewrite the patch to make it not compiz specific. Simply turn on ARGB colormap by default and allow a argb solid fill (even if you can only set the alpha in gconf).
For plasma it was only a change from image.fill(m_color.rgb()) to image.fill(m_color.rgba()).
Oasisgames
March 19th, 2008, 07:24 PM
New wallpaper plugin commited. (You will have to update bcop too)
I see what you did thar..
So... it fakes a desktop window? Sounds a lot better than my method... Anyway, quite nice. I'll definitely scrap all of my changes when I get home and go with this. May even take the time to patch Nautilus on my desktop.
Quick question: Does it still work with the Nautilus patch? (Does it still set the atom, I'm too busy to look right now, I will when I get home)
- It does.
Regardless, I'll look into enabling RGBA for the Nautilus wallpaper, it seems to be my "thing" these days...
e: One other question: Does image transparency (in PNGs) work? I assume it does, because you used Cairo, just too lazy to actually go see right now.
- Yep.
e: I'm recompiling everything as I type this ;)
Here it is with curved Expo (http://random.ogunderground.com/workstation/mar_13/wallpaper_new.png). Absolutely amazing.
I move that onestone's rewritten Wallpaper plugin be added to -extra.
plun
March 21st, 2008, 01:05 PM
Regardless, I'll look into enabling RGBA for the Nautilus wallpaper, it seems to be my "thing" these days...
Here it is with curved Expo (http://random.ogunderground.com/workstation/mar_13/wallpaper_new.png). Absolutely amazing.
Well, what is the "thing" ?....;)
I haven't tried the solution in the other thread about Nautilus.
Current Wallpaper plugin fails loading all pics on Gnome.
About RGBA and nVidia (http://www.nvnews.net/vbulletin/showthread.php?t=107825&highlight=icon), if someone missed it.
:)
Oasisgames
March 21st, 2008, 01:15 PM
Well, what is the "thing" ?....;)
I haven't tried the solution in the other thread about Nautilus.
Current Wallpaper plugin fails loading all pics on Gnome.
About RGBA and nVidia (http://www.nvnews.net/vbulletin/showthread.php?t=107825&highlight=icon), if someone missed it.
:)
Add all the image loading plugins and deps in the XML. I just use SVGs, so I have it set up as such. That worked for me.
plun
March 21st, 2008, 01:20 PM
Add all the image loading plugins and deps in the XML. I just use SVGs, so I have it set up as such. That worked for me.
You mean in wallpaper.xml ? (/home/username/.compiz/metadata)
and where ?
:confused: "Noob"...:D
Oasisgames
March 21st, 2008, 01:28 PM
<long>Draw the desktop wallpaper</long>
<category>Utility</category>
<deps>
<relation type="after">
<plugin>svg</plugin>
</relation>
</deps>
<screen>
<subgroup>
Etc.
plun
March 21st, 2008, 01:36 PM
<long>Draw the desktop wallpaper</long>
<category>Utility</category>
<deps>
<relation type="after">
<plugin>svg</plugin>
</relation>
</deps>
<screen>
<subgroup>Etc.
OK, testing....let Inkscape build some pics first maybe...:)
plun
March 24th, 2008, 12:16 PM
Followup...:p
Loads without errors...with Nautilus patched just a white cube... without patch nothing happens, Wallpapers are behind the white curtain....:(
http://pix.nofrag.com/6/9/b/01cb6247b5c2723ea9f26342b328dt.jpg (http://pix.nofrag.com/6/9/b/01cb6247b5c2723ea9f26342b328d.html)
:confused:
Oasisgames
March 24th, 2008, 02:15 PM
Followup...:p
Loads without errors...with Nautilus patched just a white cube... without patch nothing happens, Wallpapers are behind the white curtain....:(
http://pix.nofrag.com/6/9/b/01cb6247b5c2723ea9f26342b328dt.jpg (http://pix.nofrag.com/6/9/b/01cb6247b5c2723ea9f26342b328d.html)
:confused:
Oh, snap, you're on Hardy. No, the patches won't work on Hardy as there were major changes to the Eel library in Gnome 2.22. We have to wait until the Gnome guys fix things up. You're only chance is to disable Nautilus' rendering of the desktop.
plun
March 24th, 2008, 02:51 PM
You're only chance is to disable Nautilus' rendering of the desktop.
OK, thanks !
Really annoying when you sees beautiful wallpapers for a while during C-F restarts..:(
I don't think Gnome ever will patch this... just a principle in the book...:rolleyes:
KDE4 maybe can force them...:cool:
plun
March 29th, 2008, 09:52 AM
Well, start the hacking party...;)
http://live.gnome.org/SummerOfCode2008/Ideas
Individual Workspace Wallpapers (mentor: ManuCornet (http://live.gnome.org/ManuCornet))
Benefits: Usability improvements, related code refactoring, support for composite bling
Requirements: C programming, gtk+, familiarity with revision control system
Note: Based on an open bug aging back to 2001 (http://bugzilla.gnome.org/show_bug.cgi?id=48004)
References
http://mail.gnome.org/archives/wm-spec-list/2008-March/msg00017.html
Original proposal from Compiz developer
http://bugzilla.gnome.org/show_bug.cgi?id=444320
SVN sources
Eel
http://svn.gnome.org/viewvc/eel/
Nautilus
http://svn.gnome.org/viewvc/nautilus/
Oasisgames
March 29th, 2008, 08:40 PM
I would, but I can't participate in the GSoC (haven't even applied to a college yet, much less been accepted)
plun
March 29th, 2008, 09:09 PM
I would, but I can't participate in the GSoC (haven't even applied to a college yet, much less been accepted)
Go for it...;)
Send a mail to the mentor and ask.
You knows Compiz and new devs are for sure needed, maybe a group
of new devs ?
subixonfire
April 1st, 2008, 09:15 AM
there is maybe a sollution for gnome that is more simple but needs some programing expirience
- to disable nautilus desktop drawing
- then use screenlets "launcher" plugin to put some icons on desktop
but the launcer plugin woud need some work to show icons name ( text below icons) & then maybe some script that runs in background & makes launchers for all files in "~/desktop/ " folder. I em not a good programer ( still in noob faze) but i woud like wery much if someone did somthing like this!
sory if my idea looks bad or is not posible. It is yust an idea! if somewone wonts to help me with this please send me a e mail at subixonfire@gmail.com thx in advance!
ps: sory for my english it is a litle bad i know!
contrast
April 13th, 2008, 08:49 AM
there is maybe a sollution for gnome that is more simple but needs some programing expirience
- to disable nautilus desktop drawing
- then use screenlets "launcher" plugin to put some icons on desktop
but the launcer plugin woud need some work to show icons name ( text below icons) & then maybe some script that runs in background & makes launchers for all files in "~/desktop/ " folder. I em not a good programer ( still in noob faze) but i woud like wery much if someone did somthing like this!
sory if my idea looks bad or is not posible. It is yust an idea! if somewone wonts to help me with this please send me a e mail at subixonfire@gmail.com thx in advance!
ps: sory for my english it is a litle bad i know!
I personally don't think this is a bad idea at all - it's actually something I tried out myself back when I was experimenting with a "purely composited desktop environment" (really just an Xsession script that started Compiz, Screenlets and Kiba-dock). It seemed to work okay, aside from the two caveats you mentioned (manually having to create launchers and no text). I'd imagine the first problem there wouldn't be hard to solve at all if there's a DBus event for when things get dropped on the desktop, but I doubt this is the case. As for the second catch, I would also imagine having text render below the launchers would only require a few lines of code. Just keep in mind, these assumptions come from someone whose only programming experience is in BASH. :-P
aantn
April 13th, 2008, 09:12 AM
It's technically feasible, but there's a more elegant way to do it. Stein (I don't know his real name) is working on an application called cream|desktop that blings up the desktop background.
AFAIK, his goal is to run universal applets in the desktop background. (That's possible just with screenlets, but he plans on adding features like slideshowing backgrounds and applets.) It should be simple enough to add on support for multiple desktops.
I'll mention it to him on the Awn forums.
stein
April 21st, 2008, 05:18 PM
Hi there!
I am "stein"... (My real name is Sebastian Billaudelle;-).
Aantn has mentioned the important stuff... But now I want to do more...
You can watch http://cream-project.org for some more information!
Unfortunately I'm working on some other things, so I'm a littlebit shortin time now.
But I'll go on doing some integration of Screenlets to cream!
cheers Sebastian
P. S.: There is an (very) old snapshot of development of cream|desktop...
Here you can find a .deb (hope it's working alright... For some "security" it displays not ~/Desktop, but ~/Desktop2 Add some files to that folder!): http://forum.ubuntuusers.de/download/9070/
fldc
May 4th, 2008, 09:55 AM
Talking about KDE 4.1 (svn), any plans to get compiz up to speed with development and get it compiling against trunk again? :D
onestone
May 6th, 2008, 11:59 PM
kde4-window-decorator should compile again.
arboc
May 19th, 2008, 02:27 AM
Onestone:
I'm using Kubuntu 8.04 with KDE 4.0.3 and Compiz 0.7.4. After seeing your post, I edited plasma's renderthread.cpp, changing image.fill(m_color.rgb()) to image.fill(m_color.rgba()), and edited my plasma-appletsrc file according to your instructions. The result was that my desktop background is now black, but the wallpapers selected via the Compiz cube plugin do not show through. A side effect is that the desktop is not repainted correctly, meaning that if I pop up a menu, for instance, it remains painted over the black background even after the menu is closed. Also, if I move a window around, it leaves a trail over the black background, because its previous renditions are not erased as it is moved around.
My question is: is there a way to use the cube's multiple wallpapers with KDE 4.0.3, or are there other changes in KDE 4.1 that are needed (besides the change from m_color.rgb to m_color.rgba)? Or perhaps it is Compiz' version (0.7.4) that is not suitable to be used with plasma with this modification (rgb -> rgba)? I'd appreciate your help to make this work.
Sincerely,
Dan
onestone
May 20th, 2008, 02:12 PM
@arboc: You have to use the wallpaper plugin, to get different backgrounds. We have also removed the background painting code from cube, because the the wallpaper plugin provides a better solution for this problem. Please update and enable the wallpaper plugin and and it should then just work.
arboc
May 20th, 2008, 02:53 PM
Onestone:
Unfortunately, compiz 0.7.4 as packaged for (k)ubuntu Hardy does not come with the wallpaper plugin. I was hoping this trick would work with the cube's background images. I will look for a way to add the wallpaper plugin.
Thanks a lot for your reply.
Dan
pauljohn32
June 19th, 2008, 03:37 AM
I am running the kde 4.1 beta packages for Hardy Ubuntu along with compiz 0.74. THe kde beta packages comr from the repo described here http://blog.nixternal.com/2008.06.05/hardy-kde-41-beta-1-completed/ and the compiz packages were from Hardy itself.
In gnome, I have turned off nautilus background management and so compiz works fine to set the images on the background.
In KDE 4.1, however, I can't make the plasma trick work that is described at the beginning of this thread. The backgrounds are all solid gray. I've set the window manager to compiz (not the modified compiz or kwin with some compiz. real compiz). And i've gone into the config file ~/.kde4/share/config/plasma-appletsrc
wallpapercolor=0,0,0,0
I have the wallpaper plugin for compiz working fine in Gnome.
Is there any new information about how this can be made to work?
Otherwise, the performance from KDE and Compiz is pretty good.
PJ
javielillo
June 26th, 2008, 12:51 PM
pauljohn32 I got multiple wallpapers using exactly the same steps in Kubuntu hardy (installing the KDE 4.1 beta 2 from the official site (http://kubuntu.org/announcements/kde-4.1beta2.php))... only I restarted to get the changes.
Well, could be that I selected "Compiz" in "session manager" menu in System preferences before the restart instead of use fusion-icon.
http://img254.imageshack.us/img254/2255/instantnea4sl9.th.png (http://img254.imageshack.us/my.php?image=instantnea4sl9.png)
I remember that Compiz at the begining was designed for GNOME and now KDE 4.1 has a better desktop integration xD.
some-guy
June 26th, 2008, 01:28 PM
I remember that Compiz at the begining was designed for GNOME and now KDE 4.1 has a better desktop integration xD.
Compiz was originally based on metacity to reduce effort. That's why it required many gnome libs. If it was written from scratch, it would have been desktop neutral from the start
El motinak
July 31st, 2008, 10:36 PM
Hi, I have the same problem of pauljohn32. Tried what javielillo said, but it didn't work for me.
I'm using Kubuntu Hardy and Kde 4.1 on a Dell Inspiron 1525. Please, if somoene has any idea, post it!
Thanks; greetings from Chile.
adamruss
August 11th, 2008, 02:40 PM
When i use the wallpaper plugin the picture doesent look so good, if i choose the same picture with plasma the picture quality is much better - why?
here is an example of both:
some-guy
August 11th, 2008, 04:18 PM
CCSM >> General Options >> Texture Compression -> False
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.