View Full Version : My first compiz hack ( not working :( )
gnumdk
November 10th, 2006, 11:52 PM
http://puffy.homelinux.org/~gnumdk/zoom.c
I tried to add an option to zoom plugin: zoomfactor.
I tried to do like other options but i may be missing something as it doesn't work :(
Thanx for help!
mikedee
November 11th, 2006, 01:22 AM
Looks good to me, except for a few things.
You missed the precision from the float option, I added this line and set it to 0.01. It was not setting the internal value correctly otherwise.
o->rest.f.precision = ZOOM_FACTOR_PRECISION;
I also had a problem when it was set to exactly 1, it didnt seem to work. I added this quick hack to the zoomSetScreenOption. Strangely it worked if I set it to 0.9 or less.
if (zs->zoomfactor == 1.0f)
zs->zoomfactor = 1.001f;
I have seen a few other hacks like this around the place so it may be acceptable. Another (better) way around it may be to set the minimum to 1.001 or 1.01.
Let me know if you would like help preparing a patch, you should send it to the mailing list for acceptance. I do not see a reason why it would be rejected as its just an option (a good one at that) and shouldnt affect anything.
Also I think that zoom_factor for the option name and zoomFactor for the internal member name would be more acceptable to David.
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.