PDA

View Full Version : configure shortcut to scale plugin by any mouse button


ulric
December 5th, 2006, 09:20 AM
I have tried to configure via gconf-editor the shortcut for the scale plugin setting the mouse ButtonX (where X=1 .. 8) but it does not work.
For the zoom plugin is possible to configure <alt>Button4/5, but for the scale plugin similar setting does not work.

The mouse button is correctly configured and I it work with xbindkeys (in example).
Any ideas?
Thanks.

mikedee
December 5th, 2006, 03:32 PM
Actions in compiz are hard coded to only respond to keys, buttons edges, bells etc. When you see all the options in gconf to activate things with a button/edge/bell etc, it doesnt actually mean that it will work with a button shortcut. State isnt hard coded to work with buttons so even if you set it in gconf it will not work.

Its easy to fix, as long as you compile from source, here is a patch for the scale plugin which lets it activate on button presses.

--- scale.c.orig 2006-12-05 15:43:58.104894448 +0000
+++ scale.c 2006-12-05 15:46:53.562220880 +0000
@@ -1815,6 +1815,7 @@
o->value.action.state |= CompActionStateInitEdgeDnd;
o->value.action.type = CompBindingTypeKey;
o->value.action.state |= CompActionStateInitKey;
+ o->value.action.state |= CompActionStateInitButton;
o->value.action.key.modifiers = SCALE_INITIATE_MODIFIERS_DEFAULT;
o->value.action.key.keycode =
XKeysymToKeycode (display,
@@ -1833,6 +1834,7 @@
o->value.action.state |= CompActionStateInitEdgeDnd;
o->value.action.type = 0;
o->value.action.state |= CompActionStateInitKey;
+ o->value.action.state |= CompActionStateInitButton;

o = &sd->opt[SCALE_DISPLAY_OPTION_INITIATE_GROUP];
o->name = "initiate_group";
@@ -1848,6 +1850,7 @@
o->value.action.state |= CompActionStateInitEdgeDnd;
o->value.action.type = 0;
o->value.action.state |= CompActionStateInitKey;
+ o->value.action.state |= CompActionStateInitButton;
}

static Bool

You can try sending this to the mailing list if you would like it to be accepted, it probably would since it wouldn't break anything.

ulric
December 5th, 2006, 04:28 PM
Many thanks!
I will try to patch and compile.

mikedee
December 5th, 2006, 05:16 PM
I have put a stand-alone version here so that you do not have to compile all of compiz.

Just unpack and type make install then restart compiz.

http://www.anykeysoftware.co.uk/compiz/plugins/scale.tar.gz