Skip to content

Clipboard sharing with wayland guest not working #33

@sledgehammer999

Description

@sledgehammer999

Host: Windows 10
Guest: EndeavourOS (Arch based) with Plasma 6
Virtualbox version: 7.1.10
Guest additions version: 7.1.10

Problem description

Pasting from host to guest (wayland) -> works
Pasting from guest (x11) to host -> works
Pasting from guest (wayland) to host -> doesn't work

Pinpointing the problem

I did some debugging and the problem is that this check is always false:

if (uFmt != g_DcpCtx.Session.clip.uFmt.defaults())

Small description of the codeflow:

  1. vbcl_wayland_hlp_dcp_gh_clip_report_cb() waits on g_DcpCtx.Session.clip.uFmt and, if successful, it sets Session.clip.pvClipboardBuf and Session.clip.cbClipboardBuf (via a call to vbcl_wayland_hlp_dcp_receive_offer())
  2. vbcl_wayland_hlp_dcp_gh_clip_read_join_cb() sets g_DcpCtx.Session.clip.uFmt and waits on Session.clip.pvClipboardBuf and Session.clip.cbClipboardBuf
  3. vbcl_wayland_hlp_dcp_gh_clip_read_join_cb() is called after vbcl_wayland_hlp_dcp_gh_clip_report_cb()

This is a cyclic dependency that results in all those values being empty (defaulted) when read.

I think there is a logic problem here. vbcl_wayland_hlp_dcp_gh_clip_report_cb() does 2 actions that are meant to be distinct. It both reports to the host that clipboard data is available AND copies the clipboard data to internal buffers. The latter fails because it doesn't know which format the host expects at this point.
The data should be copied only after the host requests them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions