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

--- Comment #1 from Arman <[email protected]> ---
I investigated the clipboard synchronization problem further on Fedora 44 with
GNOME Wayland and KDE Connect 26.08.0.

There appear to be two related problems:

### 1. Android → Fedora

As described in my previous investigation, Android clipboard content reaches
KDE Connect, but it was not reliably propagated to the desktop clipboard. I
worked around this by writing the received text to the X clipboard using
`xclip` from `ClipboardListener::setText()`.

### 2. Fedora → Android

I have now investigated the reverse direction.

The Fedora clipboard itself is updated correctly and can be read with both:

```
xclip -selection clipboard -o
wl-paste
```

However, KDE Connect's internal `m_currentContent` is not updated when the
Fedora clipboard changes.

The following message appears when `kdeconnectd` starts:

```
Could not init WaylandClipboard, falling back to QtClipboard.
```

I also checked the Wayland globals in the GNOME session. The session provides:

```
wl_data_device_manager
```

but does not provide:

```
zwlr_data_control_manager_v1
ext_data_control_manager_v1
```

This appears to prevent `KSystemClipboard` from initializing its Wayland
clipboard implementation, causing it to fall back to `QtClipboard`.
Consequently, KDE Connect does not receive the clipboard-change notification
required to update `m_currentContent`.

### Reproduction

On Fedora:

```
printf 'FEDORA-TEST-123456\n' | xclip -selection clipboard
```

The system clipboard changes correctly, but KDE Connect's cached clipboard
content remains stale.

Calling the KDE Connect clipboard D-Bus `sendClipboard()` method then sends the
old cached content to Android.

### Workaround / confirmation

I modified the no-argument `ClipboardPlugin::sendClipboard()` to read the
current text clipboard with:

```
xclip -selection clipboard -o
```

and pass the result to the existing `sendClipboard(content)` method.

After rebuilding and installing the clipboard plugin, Fedora → Android
synchronization works correctly.

The Android → Fedora `xclip` workaround also continues to work.

So both directions are currently functional with these workarounds.

Environment:

* Fedora 44
* GNOME
* Wayland
* KDE Connect 26.08.0
* KDE Frameworks 6.30.0
* Qt 6.11.2

I can provide the modified source files and additional diagnostic output if
needed.

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

Reply via email to