Monday, June 30, 2008

Converting any window into plasmoid

Take a look at the following screenshots:

Besides familiar Clock and Calculator you can see several new plasmoids here:
  • Konsole
  • MPlayer
  • Speedcrunch calculator
  • Step physical simulator
No, I have not rewrote all that apps as plasmoids. Instead I've wrote an applet that allows you to convert any running application into plasmoid. Currently it works using XEmbed protocol and therefore have lots of problems:
  • You can't rotate these plasmoids and they don't work correctly with ZUI (however the latter can still be improved a bit)
  • Z-order of plasmoids is not respected (i.e. in case you have several overlapping plasmoids)
  • Switching between Desktop and Dashboard is not very smooth: embedded applications are only repainted after several-seconds delay
All these problems can be fixed by using Composite extension (and input redirection) instead of XEmbed but this will probably require some cooperation with KWin and will only work when Composite is enabled.

There is another problem: currently you have to manually re-configure all window-embedding plasmoids after restarting plasma. For KDE applications this can probably be partly fixed by using KDE session management, for other applications one can allow the user to setup command line of the application to start.

Despite all current limitation, I think this approach still has its own use-cases, for example when you want quick access to some of your applications from Dashboard (for example Konsole) or if you want something not-yet-available as plasmoid on your desktop (for example video player, advanced calculator, web-browser with your webmail, a game from kdegames, googleearth, ...).

If you still want to try it, the code is available in playground/base/plasma/applets/embed-win.

33 comments:

Tomasu said...

This is a neat hack, I can't wait to see it improved.. And maybe a native konsole plasmoid!

Anonymous said...

very pro!

Anonymous said...

That brings only one word to my mind - CONKY!!!

Anonymous said...

Where do we draw the line between plasmoid and a normal app ? Do we need a plasmoid calculator a normal window calculator, or do you thing they could be merged. What about other apps. I for one see no reason to have a krita plasmoid, but the line is in fact getting thinner.

Anonymous said...

Wow, I can have a Commodore 64 (under Vice) built into the wallpaper all the time.

Vladimir Kuznetsov said...

@anonymous:
"Where do we draw the line between plasmoid and a normal app ?"

Plasmoids meant to be small lightweight, persistent objects ought to always live on you desktop. Applications, on the other hand, are usually designed to be your main activity for some period of time.

Sometimes the line between applications and plasmoids does really become blurred, and in such cases the idea about embeddind application as plasmoid could be useful. Btw, it could be interesting to also have other way around: detaching a plasmoid to make it a window managed by window manager.

gon said...

Hack of the year O_O'

DanaKil said...

very nice, especially for the video player app-to-plasmoid :)

It could be even better if the background and text color could be picked from the plasma theme and applied on the fly to the plasmoified application :-)

Thanks for your work !

frinring said...

@vladimir: Yes, the other way round would make even more sense. A lot, if you ask me :) The one implementing this would be a hero for me: Free the plasmoids from their cave!

And the rotate feature could be solved with some NET property or such, so KWin would know when to offer a rotate handle.

I hope there will be a Plasma/KWin BoF session at Akademy, so this could be discussed. I have quite some ideas/ramblings I would like to discuss/propose in a patient way.

Anonymous said...

I think that this is a great idea to make plasma and KDE as a whole even better.
I hope that you will find solutions to get rid of the limitations.

But I must say: great idea. Rock on folk!

Riddle said...

The Absolute Ultimate Plasma Hack! Wow!

Lucian said...

Very cool. I don't think it would be too bad to leave this feature for composite-enabled only.

Also, you could have taken that screenshot a few seconds later.

Kit said...

*Very* awesome hack! Composite would probably solve those problems, though hopefully XEmebed will stick around as a fallback for the systems where Composite still doesn't work reliably *cough*like-mine*cough*.

The ability to make individual Plasmoids free-standing windows would also be pretty damn cool as well (for bonus points, make your application embedder work in a stand alone window that'd allow your application embedder to embed it into Plasma ;).

Absolutely lovely work, keep it up!

Mimoune said...

thanks really for this 'wonderful' applet, show them the power of plasma, so all those stupid rant about plasma will stop,

thanks

Anonymous said...

BeOS already had this feature over ten years ago:

http://www.beatjapan.org/mirror/www.be.com/products/beos_tour/screen6.html

It was integrated into their window management system and thus worked with all applications.

Anonymous said...

>BeOS already had this feature over ten years ago

BeOS is all but dead now - so, reimplementing this feature is good idea anyway.

BTW, BeOS fans still can proudly say - we were the first :)

Anonymous said...

BTW, what is the title of the film?

Dread Knight said...

Great job dude!

Now it makes more sense :-)

Grósz said...

Am I the only person who think that it's a very, very bad limitation by design of Plasma that all the plasmoids are painted in one window, not known of by the window manager, and that (FIXME but seems to me like this) an user interface can hardly be reused as application interface and as a plasmoid, introducing double coding and inconsistency between applications and Plasma?

Anonymous said...

The ability to make individual Plasmoids free-standing windows would also be pretty damn cool as well
This exists, it's called plasmoidviewer

Anonymous said...

Am I the only person who think that it's a very, very bad limitation by design of Plasma that all the plasmoids are painted in one window
Eh? The panel's a second window, plasmoidviewer is a million other windows -.-

Enderandrew said...

I would like to see all my running visual apps, be them plasmoids or normal apps in the same type of interface. I don't like having windows and plasmoids behave differently and look differently. I look forward to be able to have them all live in one space if I so desire.

Grósz said...

But those on the desktop are in one window and not handled by the window manager.

Anonymous said...

Hi,
i tried to build the code you provided. I am using KDE 8.10. Build was successful. now how can i test it.
I tried Add Widget. But it is not displaying it. also plasmoidviewr saying unknown applet.

This is same for the tutorial from techbase.kde.org. That tutorial sometimes shows up in the Add Widget window. But it is not consistent.

Please help.
my mail id: sija_j04@yahoo.com

Carnero said...

Could someone give me some advice on how to compile the source code? If I use g++ it gives me a lot of errors...

thanks.

Hamra said...

hi there, very cool plasmoid i've been using for months, i always recompile it after each KDE update, but now in KDE 4.2, loads of studd is deprecated, can you please ewrite it for KDE 4.2? i'll be thankful :)

testerus said...

This plasmoid sounds great. Is there an update to this? Does it work with KDE 4.2?
Also it would be nice if you could add this plasmoid to kde-look.org or kde-apps.org to make it easier to find. TIA.

123 123 said...

Cool story you got here. It would be great to read more about that theme.
By the way look at the design I've made myself Companionship in London

SanskritFritz said...

I installed this excellent package in my KDE4. Works great when I add it to the desktop, it embeds Pidgin or Choqok or anything. However, when I add the plasmoid to a panel, it shrinks to a minimal size, rendering the embedded application unusable. I couldnt find a way to enlarge the widget, and even though the embedded application works well, it is unusable due to the minimal size. Please help me. (KDE 4.4.5, Archlinux)

Anonymous said...

Good Work! Bug: When i use this plasmoid and no window is in front of the desktop plasmoid is working fine. If another window is in front of the desktop plasmoid says:
Client is embedded. If you see this text please report a bug.

André Frick said...

Hi Vladimir!

I know, this is a very old post but is there any new information on improving your idea using compositing?
I'd love to try if this can be done. But right now i don't really know where to start.
Could you give me a hand and explain a bit more in detail how to do this in cooperation with KWin?
I mean: KWin is a complex thing so i don't know where in the docs to look at first.
BTW: Your code works in 4.8.2 despite the clientIsEmbedded-Problem if the plasmoid has no focus. Also: Two Instances of the embed-win-plasmoid don't work at the same time.
e.g. google-chrome in one instance and tvtime in another. One can only see one at a time while the other states "client is embedded..."

Cheers,
André

episteme said...

hello
thanks for your app

can you teach me how to compile this plasmoid and install it ,

thanks

Hai Zaar said...

Still works wonders! Thank you!