wayland: Send wl_data_offer.source_actions before wl_data_device.enter
This makes kwin's behavior consistent with other wayland compositors (sway, GNOME Shell, etc) and it's reasonable to provide all the information about the data source before wl_data_device.enter. It also makes Firefox happier. Relevant discussion upstream: https://gitlab.freedesktop.org/wayland/wayland/-/issues/322 CCBUG: 445661
This commit is contained in:
parent
7b3ae310e6
commit
3546cc0541
1 changed files with 1 additions and 1 deletions
|
@ -156,6 +156,7 @@ DataOfferInterface *DataDeviceInterfacePrivate::createDataOffer(AbstractDataSour
|
||||||
DataOfferInterface *offer = new DataOfferInterface(source, data_offer_resource);
|
DataOfferInterface *offer = new DataOfferInterface(source, data_offer_resource);
|
||||||
send_data_offer(offer->resource());
|
send_data_offer(offer->resource());
|
||||||
offer->sendAllOffers();
|
offer->sendAllOffers();
|
||||||
|
offer->sendSourceActions();
|
||||||
return offer;
|
return offer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +309,6 @@ void DataDeviceInterface::updateDragTarget(SurfaceInterface *surface, quint32 se
|
||||||
}
|
}
|
||||||
d->send_enter(serial, surface->resource(), wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y()), offer ? offer->resource() : nullptr);
|
d->send_enter(serial, surface->resource(), wl_fixed_from_double(pos.x()), wl_fixed_from_double(pos.y()), offer ? offer->resource() : nullptr);
|
||||||
if (offer) {
|
if (offer) {
|
||||||
offer->sendSourceActions();
|
|
||||||
auto matchOffers = [dragSource, offer] {
|
auto matchOffers = [dragSource, offer] {
|
||||||
const DataDeviceManagerInterface::DnDAction action = chooseDndAction(dragSource, offer);
|
const DataDeviceManagerInterface::DnDAction action = chooseDndAction(dragSource, offer);
|
||||||
offer->dndAction(action);
|
offer->dndAction(action);
|
||||||
|
|
Loading…
Reference in a new issue