summaryrefslogtreecommitdiff
path: root/xserver/randr/rrinfo.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2009-09-06 19:44:39 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2009-09-06 19:44:39 +0000
commit9401e5643e90e23287b785e5fc238bb7c7f2d896 (patch)
tree759a23118c7bb4a1cddc87b3ad5c63f459a64bd2 /xserver/randr/rrinfo.c
parent6d29d2deb77299e537a0daf2babf0e217ce51376 (diff)
update to xserver 1.6.4rc1. Tested by many, ok oga@.
Diffstat (limited to 'xserver/randr/rrinfo.c')
-rw-r--r--xserver/randr/rrinfo.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/xserver/randr/rrinfo.c b/xserver/randr/rrinfo.c
index 7e77d393d..949da2745 100644
--- a/xserver/randr/rrinfo.c
+++ b/xserver/randr/rrinfo.c
@@ -35,7 +35,7 @@ RROldModeAdd (RROutputPtr output, RRScreenSizePtr size, int refresh)
RRModePtr *modes;
memset (&modeInfo, '\0', sizeof (modeInfo));
- sprintf (name, "%dx%d", size->width, size->height);
+ snprintf (name, sizeof(name), "%dx%d", size->width, size->height);
modeInfo.width = size->width;
modeInfo.height = size->height;
@@ -170,7 +170,7 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations)
/* notice current mode */
if (newMode)
RRCrtcNotify (crtc, newMode, 0, 0, pScrPriv->rotation,
- 1, &output);
+ NULL, 1, &output);
}
#endif
@@ -178,12 +178,20 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations)
* Poll the driver for changed information
*/
Bool
-RRGetInfo (ScreenPtr pScreen)
+RRGetInfo (ScreenPtr pScreen, Bool force_query)
{
rrScrPriv (pScreen);
Rotation rotations;
int i;
+ /* Return immediately if we don't need to re-query and we already have the
+ * information.
+ */
+ if (!force_query) {
+ if (pScrPriv->numCrtcs != 0 || pScrPriv->numOutputs != 0)
+ return TRUE;
+ }
+
for (i = 0; i < pScrPriv->numOutputs; i++)
pScrPriv->outputs[i]->changed = FALSE;
for (i = 0; i < pScrPriv->numCrtcs; i++)