PDA

View Full Version : I'm making a new plugin: thumbnail


stjepan
December 31st, 2006, 03:54 PM
Here's an early screenie:
http://pix.nofrag.com/00/3a/4c524b8cbe721d5bbb43a4b7700d.jpg

This is actually hacked switcher. It's my first Compiz plugin so I don't know very much about Compiz, but I'm progressing slowly (making it two days now).

I have one problem with it though. in thumbPaintScreen function I have this:
Bool status;

SWITCH_SCREEN (s);

if(activated)
mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;

{
UNWRAP (ss, s, paintScreen);
status = (*s->paintScreen) (s, sAttrib, region, output, mask);
WRAP (ss, s, paintScreen, switchPaintScreen);
}

return status;
The mask slows down everything a lot. Rotating cube while thumbnail is activated is very slow. Can I tweak this somehow to speed things up?

stjepan
January 1st, 2007, 04:59 PM
OK the bugs are dead now :)

I've got a question:
Can I get pixmaps of minimized windows?

mikedee
January 1st, 2007, 05:10 PM
Items 2 and 3 are related to getting the texture of unmapped windows. I am not sure if it works or not yet though.

http://lists.freedesktop.org/archives/compiz/2006-November/000870.html

In theory, it should work the same way as getting the pixmap for a mapped window. If it doesn't work then it is likely he hasn't finished those bits yet. It should all work soon.

stjepan
January 1st, 2007, 06:39 PM
Thanks.

Next question: I want to send my plugin via dbus window id. How to implement this? What should the dbus-send command look like? How to get that window id in the plugin?

mikedee
January 1st, 2007, 11:57 PM
If you want to get your plugin to thumbnail a particular window then you need to use the getIntOptionNamed function. Something like this.

static Bool
thumbnailInitiate (CompDisplay *d,
CompAction *action,
CompActionState state,
CompOption *option,
int nOption)
{
int window_id = getIntOptionNamed (option, nOption, "window_id", 0);

.....

All your action options are automatically available to dbus and are available with dbus-send like this.

dbus-send --type=method_call --dest=org.freedesktop.compiz /org/freedesktop/compiz/plugin_name/allscreens/action_name org.freedesktop.compiz.activate parameters

Parameters are sent via dbus in key value pairs, each key and value must be typecast on the command line (keys are always strings). eg.

string:'window_id' int32:0x12345

stjepan
January 2nd, 2007, 10:17 AM
Thank you.

After playing with dbus, modifying libnwck and improving my plugin I got nice effects so I made a video.
http://video.google.com/videoplay?docid=-8276968601342553636

stjepan
January 2nd, 2007, 06:06 PM
The plugin is progressing well... here's a newer video: http://video.google.com/videoplay?docid=-6092022018589488823

I have another question: how can I get event when scale, switcher, zoom or inputzoom are initiated? Is this possible?

mikedee
January 2nd, 2007, 06:23 PM
The plugin is progressing well... here's a newer video: http://video.google.com/videoplay?docid=-6092022018589488823

I dont have flash at the moment (and64) so I cannot see it :(

I have another question: how can I get event when scale, switcher, zoom or inputzoom are initiated? Is this possible?

Its a good question and as far as I know it isn't possible at the moment (other than by polling the otherScreenGrabExists function). It is needed for a few other plugins so I think I will try to send a patch. It would be nice to have how it was initiated (eg, by key/mouse/edge/other).

PS - Moved to Plugin Development as its more relevant there

stjepan
January 2nd, 2007, 07:35 PM
Can I prevent those plugins from being activated when mine is activated?

PS - this topic is just to get help at developing the plugin, I'll make a new topic with releases, news, bugs etc.

mikedee
January 2nd, 2007, 08:13 PM
Can I prevent those plugins from being activated when mine is activated?

No, they have to be written to not activate when yours has a screen grab. Its fairly easy to do. A lot of them just test to see if any plugin has a grab before not initiating. There are only a few that detect for certain plugins. Its probably nicer to make your not initiate if any plugin has grab rather than testing for specific grabs.

PS - this topic is just to get help at developing the plugin, I'll make a new topic with releases, news, bugs etc.

No problem, its more for developers so maybe developer help might be better, heres fine now though ;)

stjepan
January 2nd, 2007, 08:22 PM
I dont have flash at the moment (and64) so I cannot see it :(

There's the download button at the right...

Tnx I'll see what can I do about those plugin "conflicts"..

gnumdk
January 4th, 2007, 05:21 PM
It should be cool to have some code available to be able to test, debug and why not help you :)

stjepan
January 4th, 2007, 07:26 PM
News:
* fixed borders
* I'll drop dbussing and use xproperties
* license: GPL
* added fading (will be an option) when switching between buttons

I can't release it yet, the code is still dirty, there's no gconf schema, no options, no xproperties.

I only have a nice screenshot for you:
http://pix.nofrag.com/e2/5a/b3676075609dd8f84b39e7d5a868.jpeg

mikedee
January 4th, 2007, 07:59 PM
I can't release it yet, the code is still dirty, there's no gconf schema, no options, no xproperties.

You do not need to worry about the gconf schema, I can generate that for you if you like :)

Looking forward to a release

stjepan
January 4th, 2007, 09:04 PM
Tnx, what's your email address?