Currently, many areas in a Plasma Wayland session that attempt to do colour picking don't use the KWin API, because they haven't been made to support it. Porting KDE things that don't use this API to use it (or an equivalent, such as the screenshot portal's PickColor method) should be done.
Description
Description
Comment Actions
There's the org.kde.plasma.colorpicker that does this.
It's using dbus:
void KWinWaylandGrabber::pick() { QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KWin"), QStringLiteral("/ColorPicker"), QStringLiteral("org.kde.kwin.ColorPicker"), QStringLiteral("pick")); auto call = QDBusConnection::sessionBus().asyncCall(msg); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this); connect(watcher, &QDBusPendingCallWatcher::finished, this, [this] (QDBusPendingCallWatcher *watcher) { watcher->deleteLater(); QDBusPendingReply<QColor> reply = *watcher; if (!reply.isError()) { setColor(reply.value()); } } ); }
Maybe it would be easier if you explained what you're trying to achieve?
Comment Actions
Ah. That's entirely dysfunctional for me, so I assumed it was attempting to grab via X11 shenanigans and not via an API.
Still, there's areas in an average KDE session that need to use this API but don't on Wayland, and I think something cross-desktop would be appreciated for non-KDE applications.
Edit: some research shows the Screenshot portal has a PickColor method.