mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:27:45 +00:00
SpiceAgent: Don't send ClipboardGrab if the shared clipboard is disabled
The spice server will ignore any clipboard-related messages if we don't have the appropriate capabilities, but I think it's better for us to do less CPU churning whenever the user copies something to their clipboard. It also stops the spice server from warning in the console about a clipboard grab message being recieved when the capability was never announced.
This commit is contained in:
parent
4e47e6a3d6
commit
bafc1193ee
1 changed files with 6 additions and 0 deletions
|
@ -53,6 +53,12 @@ ErrorOr<void> SpiceAgent::start()
|
|||
|
||||
ErrorOr<void> SpiceAgent::on_clipboard_update(String const& mime_type)
|
||||
{
|
||||
// NOTE: If we indicate that we don't support clipboard by demand, the spice server will ignore our messages,
|
||||
// but it will do some ugly debug logging.. so let's just not send anything instead.
|
||||
if (!m_capabilities.contains_slow(Capability::ClipboardByDemand)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
// If we just copied something to the clipboard, we shouldn't do anything here.
|
||||
if (m_clipboard_dirty) {
|
||||
m_clipboard_dirty = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue