Hi

On Tue, Sep 8, 2026 at 1:13 AM Rick Vernam <[email protected]> wrote:
>
> dbus_clipboard_update_info() drops any incoming grab whose
> QemuClipboardInfo has no serial number:
>
>     if (self_update || !info->has_serial) {
>         return;
>     }
>
> For grabs coming from ui/vdagent.c, has_serial is only set when the
> guest's vdagent client has negotiated VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL
> (see vdagent_clipboard_recv_grab()). When the guest doesn't negotiate
> it, the grab is silently dropped here and never forwarded to the
> D-Bus display client via Clipboard.Grab.
>
> It seems other protocols (ui/gtk-clipboard.c, ui/vnc-clipboard.c) do not
> incorporate a validation on has_serial, so this patch matches their
> behavior.

But dbus display relies on "serial" being valid. The client has no way
to check !info->serial. Iow, the agent must support
VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL. When not supported, the clipboard
state get out of sync due to races.

>
> Signed-off-by: Rick Vernam <[email protected]>
> ---
>  ui/dbus-clipboard.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ui/dbus-clipboard.c b/ui/dbus-clipboard.c
> index 90318384ee..1389ec0edc 100644
> --- a/ui/dbus-clipboard.c
> +++ b/ui/dbus-clipboard.c
> @@ -72,7 +72,7 @@ dbus_clipboard_update_info(DBusDisplay *dpy, 
> QemuClipboardInfo *info)
>          return;
>      }
>
> -    if (self_update || !info->has_serial) {
> +    if (self_update) {
>          return;
>      }
>
> --
> 2.55.0
>


Reply via email to