This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Obtaining QPixmap of the plasma-desktop/wallpaper

Tags: None
(comma "," separated)
User avatar
pdabrowski
Registered Member
Posts
12
Karma
0
OS
Is there a way of obtaining a QPixmap of the plasma-desktop or at least the wallpaper (but scaled/cut properly)?

I need it to create fallback pseudo-transparency for my application, used when compositing manager is not detected.
KRootPixmap class provided this in KDE3, but it seems support for this has been dropped in KDE4.

Or do you have any other ideas?


Regards,

ultr
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
In general, the KDE 4 series does not implement fake-transparency effects like this, as they tend to be unreliable. You may need to look into QImage based functions..


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
pdabrowski
Registered Member
Posts
12
Karma
0
OS
Of course real transparency is great and easier to use.

But it should be just a fallback engine. It's better to draw anything rather than a black background (result of Qt::WA_TranslucentBackground without compositing manager).

What I need is just a part of wallpaper under the window or, if no wallpaper is set, the solid color of the plasma-desktop, etc.

Is it possible to obtain these from Plasma using kdelibs?
User avatar
aseigo
KDE Developer
Posts
124
Karma
2
it's not currently possible, and there are no plans to make it possible. why? because wallpapers can animated, there is no guarantee that things such as animated transition between activities (ala Plasma Mobile) won't happen (marring the effect further) and that such "paint the wallpaper in the background of the window" are pretty lame hacks. (as in: it's not comparable at all to real translucency, which includes windows and other objects (e.g. plasmoids) behind the window as well as effects like blur.) as such we are providing no support for what would only end up being a way to provide poor results. if you don't have a compositing manager, you get "regular" window backgrounds.

that said, since wallpapers are plugins in Plasma, you could write a Plasma::Wallpaper plugin that does export a pixmap in some way and use that plugin in conjunction with your app.


aseigo, proud to be a member of KDE forums since 2008-Oct.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Dolphin encounters this issue, and simply stops rounding the corners of it's tooltip when it has no compositing I believe.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]