Przeglądaj źródła

Make vncRandRGetOutputDimensions tolerant for disabled outputs

Return error if no CRTC.
tags/v1.8.90
Peter Åstrand (astrand) 6 lat temu
rodzic
commit
d57acc34e7
3 zmienionych plików z 17 dodań i 10 usunięć
  1. 1
    1
      unix/common/RandrGlue.h
  2. 3
    3
      unix/common/randr.cxx
  3. 13
    6
      unix/xserver/hw/vnc/RandrGlue.c

+ 1
- 1
unix/common/RandrGlue.h Wyświetl plik

@@ -51,7 +51,7 @@ int vncRandRReconfigureOutput(int outputIdx, int x, int y,
int width, int height);

unsigned int vncRandRGetOutputId(int outputIdx);
void vncRandRGetOutputDimensions(int outputIdx,
int vncRandRGetOutputDimensions(int outputIdx,
int *x, int *y, int *width, int *height);

int vncRandRCreateOutputs(int extraOutputs);

+ 3
- 3
unix/common/randr.cxx Wyświetl plik

@@ -65,9 +65,9 @@ rfb::ScreenSet computeScreenLayout(OutputIdMap *outputIdMap)
newIdMap[outputId] = id;
}

vncRandRGetOutputDimensions(i, &x, &y, &width, &height);
layout.add_screen(rfb::Screen(newIdMap[outputId], x, y, width, height, 0));
if (vncRandRGetOutputDimensions(i, &x, &y, &width, &height) == 0) {
layout.add_screen(rfb::Screen(newIdMap[outputId], x, y, width, height, 0));
}
}

/* Only keep the entries that are currently active */

+ 13
- 6
unix/xserver/hw/vnc/RandrGlue.c Wyświetl plik

@@ -191,18 +191,24 @@ unsigned int vncRandRGetOutputId(int outputIdx)
return rp->outputs[outputIdx]->id;
}

void vncRandRGetOutputDimensions(int outputIdx,
int vncRandRGetOutputDimensions(int outputIdx,
int *x, int *y, int *width, int *height)
{
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
RRCrtcPtr crtc;
int swap;
*x = *y = *width = *height = 0;

*x = rp->outputs[outputIdx]->crtc->x;
*y = rp->outputs[outputIdx]->crtc->y;
*width = rp->outputs[outputIdx]->crtc->mode->mode.width;
*height = rp->outputs[outputIdx]->crtc->mode->mode.height;
crtc = rp->outputs[outputIdx]->crtc;
if (crtc == NULL || !crtc->mode)
return 1;

switch (rp->outputs[outputIdx]->crtc->rotation & 0xf) {
*x = crtc->x;
*y = crtc->y;
*width = crtc->mode->mode.width;
*height = crtc->mode->mode.height;

switch (crtc->rotation & 0xf) {
case RR_Rotate_90:
case RR_Rotate_270:
swap = *width;
@@ -210,6 +216,7 @@ void vncRandRGetOutputDimensions(int outputIdx,
*height = swap;
break;
}
return 0;
}

int vncRandRReconfigureOutput(int outputIdx, int x, int y,

Ładowanie…
Anuluj
Zapisz