Make vncRandRGetOutputDimensions tolerant for disabled outputs
Return error if no CRTC.
diff --git a/unix/common/RandrGlue.h b/unix/common/RandrGlue.h
index 48ce327..43c9b68 100644
--- a/unix/common/RandrGlue.h
+++ b/unix/common/RandrGlue.h
@@ -51,7 +51,7 @@
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);
diff --git a/unix/common/randr.cxx b/unix/common/randr.cxx
index 8581991..b0adc3f 100644
--- a/unix/common/randr.cxx
+++ b/unix/common/randr.cxx
@@ -65,9 +65,9 @@
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 */