Bug 508069 - KSystemClipboard on Gnome/Wayland
Summary: KSystemClipboard on Gnome/Wayland
Status: REPORTED
Alias: None
Product: frameworks-kguiaddons
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 6.17.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-10 00:32 UTC by Jeremy
Modified: 2025-08-12 21:47 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy 2025-08-10 00:32:52 UTC
SUMMARY
Flameshot uses KSystemClipboard provided by KGuiAddons. After porting to Qt6 our clipboard functionality stopped working on gnome + wayland. This error is reported:

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

I then wrote a very minimal working example to demonstrate this bug. If this code is executed on Gnome + Wayland the same error is printed to the terminal. Unfortunately falling back to QtClipboard does not work on gnome + wayland. Is this user error on my part with how we are using the clipboard or is there an underlying issues?

Note, this did not happen before our Qt6 port. 

```
#include <QApplication>
#include <KSystemClipboard>
#include <QDebug>
#include <QGuiApplication>

int main(int argc, char *argv[]) {
    QApplication app(argc, argv);

    auto clipboard = KSystemClipboard::instance();
    if (!clipboard) {
        qDebug() << "Failed to get KSystemClipboard instance";
        return 1;
    }

    qDebug() << "KSystemClipboard initialized successfully";
    return 0;
}
```

STEPS TO REPRODUCE
1. Compile minimal example shown above
2. See that the error is printed when run on gnome + wayland

OBSERVED RESULT
Error is reported and Qtclipboard is used as a fallback. 

EXPECTED RESULT
No error is reported and clipboard

SOFTWARE/OS VERSIONS
Arch linux, Gnome, wayland