From d084629f3cc56ba1f84af451399360706f97c3ca Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 13 Feb 2023 09:33:11 +0000 Subject: [PATCH] wayland: Version check before send_primary_selection calls This is only in v2 BUG: 465657 --- src/wayland/datacontroldevice_v1_interface.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); + } } }