wayland/selection: Relax wl_data_offer::finish requirements #1881
+3
−22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1875
Relevant logs:
Dolphin will first immediately receive the contents for the mime-type "text/x-moz-url", which is advertised and valid, but then try to issue an
acceptfor "text/uri-list", which firefox never advertised.The protocol doesn't really specify what to do in this case and since smithay tests for the mime-type, it marks the offer as
accepted = false;. Alternatively we could error out here earlier and just send some protocol error(?) but this isn't a defined error case.I think marking it as "not accepted" however is correct, because that leads to the source receiving a
cancel-event on drop and no "successful" transfer for the wrong mime-type happening, butwl_data_offer::finishonly has the following error cases:Dolphin never send a NULL-mime-type nor empty actions. So we should probably just ignore the finish request in this case? That is what this PR does, relax the requirements, so we don't protocol error on this rather harmless request.
Interestingly the drop "succeeds" from a UX perspective and Dolphin just uses the data it previously already received for the correct mime-type... To be very clear, I still think this is a client error, that should be fixed upstream, but I also don't think relaxing it this way does any harm.