aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/ClientParams.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/rfb/ClientParams.cxx')
-rw-r--r--common/rfb/ClientParams.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/common/rfb/ClientParams.cxx b/common/rfb/ClientParams.cxx
index 972b89e8..514b0b4e 100644
--- a/common/rfb/ClientParams.cxx
+++ b/common/rfb/ClientParams.cxx
@@ -24,6 +24,7 @@
#include <stdexcept>
+#include <core/LogWriter.h>
#include <core/string.h>
#include <rfb/encodings.h>
@@ -35,6 +36,8 @@
using namespace rfb;
+static core::LogWriter vlog("ClientParams");
+
ClientParams::ClientParams()
: majorVersion(0), minorVersion(0),
compressLevel(2), qualityLevel(-1), fineQualityLevel(-1),
@@ -72,8 +75,14 @@ void ClientParams::setDimensions(int width, int height)
void ClientParams::setDimensions(int width, int height, const ScreenSet& layout)
{
- if (!layout.validate(width, height))
+ if (!layout.validate(width, height)) {
+ char buffer[2048];
+ vlog.debug("Invalid screen layout for %dx%d:", width, height);
+ layout.print(buffer, sizeof(buffer));
+ vlog.debug("%s", buffer);
+
throw std::invalid_argument("Attempted to configure an invalid screen layout");
+ }
width_ = width;
height_ = height;
@@ -247,4 +256,4 @@ bool ClientParams::supportsExtendedMouseButtons() const
if (supportsEncoding(pseudoEncodingExtendedMouseButtons))
return true;
return false;
-} \ No newline at end of file
+}