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-05-13 18:21:59 +0100
commit7143e46b82767a1e6c8c9c053aa84d967e449ada (patch)
tree1f4e12db9b5d51472fa9eb86563adbb0f0710973
parenta20e8b8a1d42a1f84c9067a4978711fcfc09cc15 (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 16caea742..30b7c5f6b 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);
}
@@ -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);
}
/*