diff --git a/src/wayland/datacontroldevice_v1_interface.cpp b/src/wayland/datacontroldevice_v1_interface.cpp index 45a1992b82..0b5c980a98 100644 --- a/src/wayland/datacontroldevice_v1_interface.cpp +++ b/src/wayland/datacontroldevice_v1_interface.cpp @@ -143,7 +143,9 @@ void DataControlDeviceV1Interface::sendSelection(AbstractDataSource *other) void DataControlDeviceV1Interface::sendPrimarySelection(KWaylandServer::AbstractDataSource *other) { - DataControlOfferV1Interface *offer = d->createDataOffer(other); - d->send_primary_selection(offer ? offer->resource() : nullptr); + if (d->interfaceVersion() >= ZWLR_DATA_CONTROL_DEVICE_V1_PRIMARY_SELECTION_SINCE_VERSION) { + DataControlOfferV1Interface *offer = d->createDataOffer(other); + d->send_primary_selection(offer ? offer->resource() : nullptr); + } } }