Emit DataOfferInterface::dragAndDropActionsChanged() only if dnd actions change
With some apps, firefox specifically, it's possible to enter a dnd positive feedback loop, e.g. * kwin sends wl_data_offer::action event * the app reacts to it and calls wl_data_offer::set_actions() with the same actions * kwin re-sends the wl_data_offer::action event because DataOfferInterface::dragAndDropActionsChanged() has been emitted * the app calls wl_data_offer::set_actions() again, and so on... This should make D&D in Firefox more responsive.
This commit is contained in:
parent
c45b69595f
commit
81e7c10a73
1 changed files with 5 additions and 3 deletions
|
@ -119,10 +119,12 @@ void DataOfferInterfacePrivate::data_offer_set_actions(Resource *resource, uint3
|
|||
preferredAction = DataDeviceManagerInterface::DnDAction::Ask;
|
||||
}
|
||||
|
||||
if (supportedDnDActions != supportedActions || preferredDnDAction != preferredAction) {
|
||||
supportedDnDActions = supportedActions;
|
||||
preferredDnDAction = preferredAction;
|
||||
Q_EMIT q->dragAndDropActionsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void DataOfferInterface::sendSourceActions()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue