Add RandR support for x0vncserver
Change Xserver screen through libXrandr. For complex configurations,
all outputs must have corresponding size modes. As a special case, if
the client requests a single screen with an odd size (for example when
adjusting the size of a non-fullscreen vncviewer), find a smaller
suitable mode, and reduce the framebuffer size as well.
diff --git a/unix/x0vncserver/Geometry.cxx b/unix/x0vncserver/Geometry.cxx
index 48c1842..d911471 100644
--- a/unix/x0vncserver/Geometry.cxx
+++ b/unix/x0vncserver/Geometry.cxx
@@ -35,10 +35,16 @@
"");
Geometry::Geometry(int fullWidth, int fullHeight)
- : m_fullWidth(fullWidth),
- m_fullHeight(fullHeight),
- m_rect(0, 0, fullWidth, fullHeight)
{
+ recalc(fullWidth, fullHeight);
+}
+
+void Geometry::recalc(int fullWidth, int fullHeight)
+{
+ m_fullWidth = fullWidth;
+ m_fullHeight = fullHeight;
+ m_rect.setXYWH(0, 0, fullWidth, fullHeight);
+
// Parse geometry specification and save the result in m_rect.
const char *param = m_geometryParam.getData();
bool geometrySpecified = (strlen(param) > 0);