extendedDesktopSizeMsgs.push_back(msg);
}
-bool SMsgWriter::writeSetDesktopName() {
+void SMsgWriter::writeSetDesktopName()
+{
if (!client->supportsEncoding(pseudoEncodingDesktopName))
- return false;
+ throw Exception("Client does not support desktop name changes");
needSetDesktopName = true;
-
- return true;
}
void SMsgWriter::writeCursor()
needCursor = true;
}
-bool SMsgWriter::writeLEDState()
+void SMsgWriter::writeLEDState()
{
if (!client->supportsEncoding(pseudoEncodingLEDState))
- return false;
+ throw Exception("Client does not support LED state");
if (client->ledState() == ledUnknown)
- return false;
+ throw Exception("Server has not specified LED state");
needLEDState = true;
-
- return true;
}
-bool SMsgWriter::writeQEMUKeyEvent()
+void SMsgWriter::writeQEMUKeyEvent()
{
if (!client->supportsEncoding(pseudoEncodingQEMUKeyEvent))
- return false;
+ throw Exception("Client does not support QEMU key events");
needQEMUKeyEvent = true;
-
- return true;
}
bool SMsgWriter::needFakeUpdate()
// write the relevant pseudo-rectangle as part of the next update.
void writeDesktopSize(rdr::U16 reason, rdr::U16 result=0);
- bool writeSetDesktopName();
+ void writeSetDesktopName();
// Like setDesktopSize, we can't just write out a cursor message
// immediately.
void writeCursor();
// Same for LED state message
- bool writeLEDState();
+ void writeLEDState();
// And QEMU keyboard event handshake
- bool writeQEMUKeyEvent();
+ void writeQEMUKeyEvent();
// needFakeUpdate() returns true when an immediate update is needed in
// order to flush out pseudo-rectangles to the client.
void VNCSConnectionST::supportsLEDState()
{
+ if (client.ledState() == ledUnknown)
+ return;
+
writer()->writeLEDState();
}
if (state() != RFBSTATE_NORMAL)
return;
- if (!writer()->writeSetDesktopName()) {
- fprintf(stderr, "Client does not support desktop rename\n");
- return;
- }
+ if (client.supportsEncoding(pseudoEncodingDesktopName))
+ writer()->writeSetDesktopName();
}
void VNCSConnectionST::setLEDState(unsigned int ledstate)
client.setLEDState(ledstate);
- writer()->writeLEDState();
+ if (client.supportsLEDState())
+ writer()->writeLEDState();
}
void VNCSConnectionST::setSocketTimeouts()