diff options
author | Adam Jackson <ajax@redhat.com> | 2009-02-17 12:59:16 -0500 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-02-17 19:11:30 -0800 |
commit | 39eb1bee84b520cfa45981c445c4c976d63ab03d (patch) | |
tree | 6e406d06f8ae1732c396589aa4522859886de59c /randr | |
parent | 69a2728891e92da6a674d7313f3bb47c629b38dc (diff) |
RANDR: Fail softly on GetPanning if the screen can't do it.
Just return a zeroed-out reply in that case. This is unambiguous, and
distinguishes "you didn't name a CRTC" from "you named a CRTC that can't
do panning".
(cherry picked from commit 123093996507c4d3b6dc457240ce00f8ac42f410)
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'randr')
-rw-r--r-- | randr/rrcrtc.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 6214b8686..7edae521f 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -1015,30 +1015,31 @@ ProcRRGetPanning (ClientPtr client) pScreen = crtc->pScreen; pScrPriv = rrGetScrPriv(pScreen); - if (!pScrPriv || !pScrPriv->rrGetPanning) + if (!pScrPriv) return RRErrorBase + BadRRCrtc; + memset(&rep, 0, sizeof(rep)); rep.type = X_Reply; rep.status = RRSetConfigSuccess; rep.sequenceNumber = client->sequence; rep.length = 1; rep.timestamp = pScrPriv->lastSetTime.milliseconds; - if (! pScrPriv->rrGetPanning (pScreen, crtc, &total, &tracking, border)) - return RRErrorBase + BadRRCrtc; - - rep.left = total.x1; - rep.top = total.y1; - rep.width = total.x2 - total.x1; - rep.height = total.y2 - total.y1; - rep.track_left = tracking.x1; - rep.track_top = tracking.y1; - rep.track_width = tracking.x2 - tracking.x1; - rep.track_height = tracking.y2 - tracking.y1; - rep.border_left = border[0]; - rep.border_top = border[1]; - rep.border_right = border[2]; - rep.border_bottom = border[3]; + if (pScrPriv->rrGetPanning && + pScrPriv->rrGetPanning (pScreen, crtc, &total, &tracking, border)) { + rep.left = total.x1; + rep.top = total.y1; + rep.width = total.x2 - total.x1; + rep.height = total.y2 - total.y1; + rep.track_left = tracking.x1; + rep.track_top = tracking.y1; + rep.track_width = tracking.x2 - tracking.x1; + rep.track_height = tracking.y2 - tracking.y1; + rep.border_left = border[0]; + rep.border_top = border[1]; + rep.border_right = border[2]; + rep.border_bottom = border[3]; + } if (client->swapped) { swaps(&rep.sequenceNumber, n); |