https://bugs.kde.org/show_bug.cgi?id=525616

            Bug ID: 525616
           Summary: Clipboard sync from Android does not update system
                    clipboard on GNOME Wayland
    Classification: Applications
           Product: kdeconnect
      Version First 26.08.0
       Reported In:
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: desktop-application
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

### Description

When I use **Send Clipboard** from Android to Fedora, KDE Connect receives the
clipboard content, but it does not become the system-wide clipboard.

The content cannot be pasted into other applications such as Firefox or
Terminal. For example, after sending clipboard content from Android, running:

```bash
wl-paste
```

still returns the previous Fedora clipboard content.

### Investigation

Environment:

* Fedora 44
* GNOME 50.4
* Wayland
* KDE Connect 26.08.0
* KDE Frameworks / KGuiAddons 6.30.0
* wl-clipboard 2.2.1
* Android 12 / Samsung Galaxy A42 5G

`wayland-info` shows that the GNOME Wayland session does not advertise:

```text
ext_data_control_manager_v1
zwlr_data_control_manager_v1
```

KGuiAddons therefore reports:

```text
kf.guiaddons: Could not init WaylandClipboard, falling back to QtClipboard.
```

The KDE Connect clipboard plugin uses `KSystemClipboard`, so the received
clipboard content does not reach the system clipboard in this environment.

### Proposed solution / workaround

I modified `plugins/clipboard/clipboardlistener.cpp` so that, when KDE Connect
receives clipboard content from Android, it additionally invokes:

```bash
xclip -selection clipboard
```

and writes the received text to its standard input.

On GNOME Wayland, XWayland then transfers the X11 clipboard content into the
normal GNOME/Wayland clipboard.

The resulting path is:

Android → KDE Connect → xclip → XWayland → GNOME/Wayland clipboard

This workaround was tested successfully. After the modification, `wl-paste`
immediately returned the clipboard content received from Android, and the
content was available for normal paste operations in Fedora applications.

The reverse direction (Fedora → Android) also continued to work correctly.

I suggest considering a GNOME/Wayland-compatible fallback in KDE Connect when
the `ext_data_control_manager_v1` and `zwlr_data_control_manager_v1` protocols
are unavailable, preferably without requiring users to manually install or
configure `xclip`.

### Expected behavior

Clipboard content received from Android should become the normal system
clipboard and be immediately available to other applications on GNOME Wayland.

### Actual behavior

KDE Connect receives the content but does not update the system-wide clipboard
when running under GNOME Wayland.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to