diff options
author | Keith Packard <keithp@guitar.keithp.com> | 2006-09-20 13:14:53 -0700 |
---|---|---|
committer | Keith Packard <keithp@guitar.keithp.com> | 2006-09-20 13:14:53 -0700 |
commit | 9f870e0aa1ada238d6a0cd099996e8c47f6ba1d9 (patch) | |
tree | 11c051b8faf42c100965590738a9b4314c859c31 /randr/rroutput.c | |
parent | d08718d8fd31477e90f13b9e122504c515b46ee0 (diff) |
When setting output state, leave output unchanged when setting to current.
Diffstat (limited to 'randr/rroutput.c')
-rw-r--r-- | randr/rroutput.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/randr/rroutput.c b/randr/rroutput.c index 3d4c16342..a4f5a66dd 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -88,7 +88,16 @@ RROutputSetClones (RROutputPtr output, int numClones) { RROutputPtr *newClones; + int i; + if (numClones == output->numClones) + { + for (i = 0; i < numClones; i++) + if (output->clones[i] != clones[i]) + break; + if (i == numClones) + return TRUE; + } if (numClones) { newClones = xalloc (numClones * sizeof (RROutputPtr)); @@ -112,6 +121,20 @@ RROutputSetModes (RROutputPtr output, int numModes) { RRModePtr *newModes; + int i; + + if (numModes == output->numModes) + { + for (i = 0; i < numModes; i++) + if (output->modes[i] != modes[i]) + break; + if (i == numModes) + { + for (i = 0; i < numModes; i++) + RRModeDestroy (modes[i]); + return TRUE; + } + } if (numModes) { @@ -122,7 +145,11 @@ RROutputSetModes (RROutputPtr output, else newModes = NULL; if (output->modes) + { + for (i = 0; i < output->numModes; i++) + RRModeDestroy (output->modes[i]); xfree (output->modes); + } memcpy (newModes, modes, numModes * sizeof (RRModePtr)); output->modes = newModes; output->numModes = numModes; @@ -136,7 +163,16 @@ RROutputSetCrtcs (RROutputPtr output, int numCrtcs) { RRCrtcPtr *newCrtcs; + int i; + if (numCrtcs == output->numCrtcs) + { + for (i = 0; i < numCrtcs; i++) + if (output->crtcs[i] != crtcs[i]) + break; + if (i == numCrtcs) + return TRUE; + } if (numCrtcs) { newCrtcs = xalloc (numCrtcs * sizeof (RRCrtcPtr)); @@ -157,6 +193,8 @@ RROutputSetCrtcs (RROutputPtr output, void RROutputSetCrtc (RROutputPtr output, RRCrtcPtr crtc) { + if (output->crtc == crtc) + return TRUE; output->crtc = crtc; output->changed = TRUE; } @@ -165,6 +203,8 @@ Bool RROutputSetConnection (RROutputPtr output, CARD8 connection) { + if (output->connection == connection) + return TRUE; output->connection = connection; output->changed = TRUE; return TRUE; @@ -174,6 +214,9 @@ Bool RROutputSetSubpixelOrder (RROutputPtr output, int subpixelOrder) { + if (output->subpixelOrder == subpixelOrder) + return TRUE; + output->subpixelOrder = subpixelOrder; output->changed = TRUE; return TRUE; |