Commit f669d700 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

wayland: Fix supported action initialization in data offer interface

Currently we guess the supported and preferred dnd actions in data offer
for version >= 3. This can create problems because kwin may not send the
right action events when the supported dnd actions actually change.
parent 8d219871
Pipeline #177201 passed with stage
in 5 minutes and 31 seconds
......@@ -25,9 +25,8 @@ public:
DataOfferInterface *q;
QPointer<AbstractDataSource> source;
// defaults are set to sensible values for < version 3 interfaces
DataDeviceManagerInterface::DnDActions supportedDnDActions = DataDeviceManagerInterface::DnDAction::Copy | DataDeviceManagerInterface::DnDAction::Move;
DataDeviceManagerInterface::DnDAction preferredDnDAction = DataDeviceManagerInterface::DnDAction::Copy;
DataDeviceManagerInterface::DnDActions supportedDnDActions = DataDeviceManagerInterface::DnDAction::None;
DataDeviceManagerInterface::DnDAction preferredDnDAction = DataDeviceManagerInterface::DnDAction::None;
protected:
void data_offer_destroy_resource(Resource *resource) override;
......@@ -43,6 +42,11 @@ DataOfferInterfacePrivate::DataOfferInterfacePrivate(AbstractDataSource *_source
, q(_q)
, source(_source)
{
// defaults are set to sensible values for < version 3 interfaces
if (wl_resource_get_version(resource) < WL_DATA_OFFER_ACTION_SINCE_VERSION) {
supportedDnDActions = DataDeviceManagerInterface::DnDAction::Copy | DataDeviceManagerInterface::DnDAction::Move;
preferredDnDAction = DataDeviceManagerInterface::DnDAction::Copy;
}
}
void DataOfferInterfacePrivate::data_offer_accept(Resource *resource, uint32_t serial, const QString &mime_type)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment