encodings.push_back(pseudoEncodingDesktopSize);
encodings.push_back(pseudoEncodingExtendedDesktopSize);
}
- if (supportsLEDState)
+ if (supportsLEDState) {
encodings.push_back(pseudoEncodingLEDState);
+ encodings.push_back(pseudoEncodingVMwareLEDState);
+ }
encodings.push_back(pseudoEncodingDesktopName);
encodings.push_back(pseudoEncodingLastRect);
break;
case pseudoEncodingLEDState:
readLEDState();
+ break;
+ case pseudoEncodingVMwareLEDState:
+ readVMwareLEDState();
+ break;
case pseudoEncodingQEMUKeyEvent:
handler->supportsQEMUKeyEvent();
break;
handler->setLEDState(state);
}
+
+void CMsgReader::readVMwareLEDState()
+{
+ rdr::U32 state;
+
+ state = is->readU32();
+
+ // As luck has it, this extension uses the same bit definitions,
+ // so no conversion required
+
+ handler->setLEDState(state);
+}
void readSetDesktopName(int x, int y, int w, int h);
void readExtendedDesktopSize(int x, int y, int w, int h);
void readLEDState();
+ void readVMwareLEDState();
CMsgHandler* handler;
rdr::InStream* is;
{
if (supportsEncoding(pseudoEncodingLEDState))
return true;
+ if (supportsEncoding(pseudoEncodingVMwareLEDState))
+ return true;
return false;
}
void SMsgWriter::writeLEDState()
{
- if (!client->supportsEncoding(pseudoEncodingLEDState))
+ if (!client->supportsEncoding(pseudoEncodingLEDState) &&
+ !client->supportsEncoding(pseudoEncodingVMwareLEDState))
throw Exception("Client does not support LED state");
if (client->ledState() == ledUnknown)
throw Exception("Server has not specified LED state");
void SMsgWriter::writeLEDStateRect(rdr::U8 state)
{
- if (!client->supportsEncoding(pseudoEncodingLEDState))
+ if (!client->supportsEncoding(pseudoEncodingLEDState) &&
+ !client->supportsEncoding(pseudoEncodingVMwareLEDState))
throw Exception("Client does not support LED state updates");
if (client->ledState() == ledUnknown)
throw Exception("Server does not support LED state updates");
os->writeS16(0);
os->writeU16(0);
os->writeU16(0);
- os->writeU32(pseudoEncodingLEDState);
- os->writeU8(state);
+ if (client->supportsEncoding(pseudoEncodingLEDState)) {
+ os->writeU32(pseudoEncodingLEDState);
+ os->writeU8(state);
+ } else {
+ os->writeU32(pseudoEncodingVMwareLEDState);
+ os->writeU32(state);
+ }
}
void SMsgWriter::writeQEMUKeyEventRect()
// VMware-specific
const int pseudoEncodingVMwareCursor = 0x574d5664;
+ const int pseudoEncodingVMwareLEDState = 0x574d5668;
int encodingNum(const char* name);
const char* encodingName(int num);