Commit 2549ab20 authored by Jon Turney's avatar Jon Turney

hw/xwin: Always keep RANDR fake mode information up to date

The rrGetInfo hook is not called for all RANDR requests (e.g.
RRGetOutputInfo), so we must always keep the fake mode information up to
date, rather than doing it lazily in the rrGetInfo hook)

Because we are so bad, most GTK+3 versions treat the output name 'default'
specially, and don't try to use RANDR with it.  But versions 3.21.6 to
3.22.24, don't do this, and get badly confused by a CRTC with size 0x0.


Future work: Rather than reporting a single fake CRTC with a mode matching
the entire virtual display, the fake CRTCs we report should match our
'pseudo-xinerama' monitors
parent b078e034
......@@ -42,17 +42,17 @@
static Bool
winRandRGetInfo(ScreenPtr pScreen, Rotation * pRotations)
rrScrPrivPtr pRRScrPriv;
RROutputPtr output;
pRRScrPriv = rrGetScrPriv(pScreen);
output = pRRScrPriv->outputs[0];
winDebug("winRandRGetInfo ()\n");
/* Don't support rotations */
*pRotations = RR_Rotate_0;
return TRUE;
static void
winRandRUpdateMode(ScreenPtr pScreen, RROutputPtr output)
/* Delete previous mode */
if (output->modes[0])
......@@ -83,8 +83,6 @@ winRandRGetInfo(ScreenPtr pScreen, Rotation * pRotations)
mode = RRModeGet(&modeInfo, name);
output->crtc->mode = mode;
return TRUE;
......@@ -95,6 +93,7 @@ winDoRandRScreenSetSize(ScreenPtr pScreen,
CARD16 width,
CARD16 height, CARD32 mmWidth, CARD32 mmHeight)
rrScrPrivPtr pRRScrPriv;
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
WindowPtr pRoot = pScreen->root;
......@@ -136,6 +135,10 @@ winDoRandRScreenSetSize(ScreenPtr pScreen,
// and arrange for it to be repainted
pScreen->PaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND);
// Set mode to current display size
pRRScrPriv = rrGetScrPriv(pScreen);
winRandRUpdateMode(pScreen, pRRScrPriv->primaryOutput);
/* Indicate that a screen size change took place */
......@@ -270,6 +273,9 @@ winRandRInit(ScreenPtr pScreen)
/* Ensure we have space for exactly one mode */
output->modes = malloc(sizeof(RRModePtr));
output->modes[0] = NULL;
/* Set mode to current display size */
winRandRUpdateMode(pScreen, output);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment