1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:57:45 +00:00

SpiceAgent: Implement ClipboardGrab messages

This commit is contained in:
Caoimhe 2023-05-13 13:32:03 +01:00 committed by Andreas Kling
parent 79c73dd260
commit 8202f13169
3 changed files with 119 additions and 0 deletions

View file

@ -64,6 +64,20 @@ ErrorOr<void> SpiceAgent::on_message_received()
break;
}
case Message::Type::ClipboardGrab: {
auto message = TRY(ClipboardGrabMessage::read_from_stream(stream));
if (message.types().is_empty())
break;
auto data_type = message.types().first();
if (data_type == ClipboardDataType::None)
break;
dbgln_if(SPICE_AGENT_DEBUG, "The spice server has notified us of new clipboard data of type: {}", data_type);
break;
}
// We ignore certain messages to prevent it from clogging up the logs.
case Message::Type::MonitorsConfig:
dbgln_if(SPICE_AGENT_DEBUG, "Ignored message: {}", header);