summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDavid Reveman <davidr@novell.com>2007-05-31 20:25:47 -0400
committerDavid Reveman <davidr@novell.com>2007-05-31 20:25:47 -0400
commit05bbdb545b6885b35fa87e41f78ddba69e5356f2 (patch)
tree5e4b168e013790430d1cbe39247f59ed6bc8b368 /plugins
parent9631928833ff76ffa1d3d46535cf8c3ab2758fcc (diff)
Track output changes.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/zoom.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/plugins/zoom.c b/plugins/zoom.c
index 10f233bd..2ac4c26d 100644
--- a/plugins/zoom.c
+++ b/plugins/zoom.c
@@ -250,28 +250,33 @@ zoomPaintOutput (CompScreen *s,
const ScreenPaintAttrib *sAttrib,
const CompTransform *transform,
Region region,
- int output,
+ CompOutput *output,
unsigned int mask)
{
CompTransform zTransform = *transform;
Bool status;
+ int i, outputNum = -1;
ZOOM_SCREEN (s);
- if (zs->zoomed & (1 << output))
+ for (i = 0; i < s->nOutputDev; i++)
+ if (output == &s->outputDev[i])
+ outputNum = i;
+
+ if (outputNum >= 0 && (zs->zoomed & (1 << outputNum)))
{
int saveFilter;
ZoomBox box;
float scale, x, y, x1, y1;
- float oWidth = s->outputDev[output].width;
- float oHeight = s->outputDev[output].height;
+ float oWidth = output->width;
+ float oHeight = output->height;
mask &= ~PAINT_SCREEN_REGION_MASK;
- zoomGetCurrentZoom (s, output, &box);
+ zoomGetCurrentZoom (s, outputNum, &box);
- x1 = box.x1 - s->outputDev[output].region.extents.x1;
- y1 = box.y1 - s->outputDev[output].region.extents.y1;
+ x1 = box.x1 - output->region.extents.x1;
+ y1 = box.y1 - output->region.extents.y1;
scale = oWidth / (box.x2 - box.x1);
@@ -288,7 +293,7 @@ zoomPaintOutput (CompScreen *s,
saveFilter = s->filter[SCREEN_TRANS_FILTER];
- if ((zs->zoomOutput != output || !zs->adjust) && scale > 3.9f)
+ if ((zs->zoomOutput != outputNum || !zs->adjust) && scale > 3.9f)
s->filter[SCREEN_TRANS_FILTER] = COMP_TEXTURE_FILTER_FAST;
UNWRAP (zs, s, paintOutput);