wayland: Version check before send_primary_selection calls

This is only in v2

BUG: 465657
(cherry picked from commit d084629f3cc56ba1f84af451399360706f97c3ca)
icc-effect-5.27.2
David Edmundson 2023-02-13 09:33:11 +00:00 committed by Vlad Zahorodnii
parent ded282df2e
commit 0bc6600ce8
1 changed files with 4 additions and 2 deletions

View File

@ -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);
}
}
}