[compiz] Patch for zoom with mixed resolutions
Mike Cook
mcook at novell.com
Tue Nov 7 15:46:26 PST 2006
Hey, David, with the latest changes for output-specific zoom it wasn't focusing
properly for me with mixed resolutions. I think this patch corrects that.
(Oh, and on my previous comment I meant struts and not extents, if that was
confusing to anyone. It was to me when I re-read it, heh.)
...MC
-------------- next part --------------
--- plugins/zoom.c
+++ plugins/zoom.c
@@ -480,8 +480,12 @@
if (zs->currentZoom == 1.0f)
{
- zs->xTranslate = (x - s->width / 2) / (s->width * 2.0f);
- zs->yTranslate = (y - s->height / 2) / (s->height * 2.0f);
+ CompOutput *o = &s->outputDev[zs->zoomOutput];
+
+ zs->xTranslate = ((x - o->region.extents.x1) - o->width / 2) /
+ (s->width * 2.0f);
+ zs->yTranslate = ((y - o->region.extents.y1) - o->height / 2) /
+ (s->height * 2.0f);
zs->xTranslate /= zs->newZoom;
zs->yTranslate /= zs->newZoom;
More information about the compiz
mailing list