summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-03-09 14:16:01 +0000
committerJon Turney <jon.turney@dronecode.org.uk>2018-03-12 15:11:42 +0000
commite9fef5a369801039d015734c1352b8418a84dd6c (patch)
tree8a497fe85798c4e3bcd3b47ea938c0d2f5c5cb87
parent75b355c15483dd3b8de259c9eaecd2a0fe42b22b (diff)
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. See: https://bugzilla.gnome.org/show_bug.cgi?id=771033 https://bugzilla.gnome.org/show_bug.cgi?id=780101 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
-rw-r--r--hw/xwin/winrandr.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c
index 1c1047a45..1bd97f963 100644
--- a/hw/xwin/winrandr.c
+++ b/hw/xwin/winrandr.c
@@ -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;
winScreenPriv(pScreen);
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 */
RRScreenSizeNotify(pScreen);
}
@@ -272,6 +275,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);
}
/*