Commit 33e2cb7c authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

ozone/x11: complete request on SelectionNotify.

Currently, X11ClipboardOzone continues to keep the request even
though OnSelectionNotify comes. This may result in clients waiting
until the request is processed or sending another request at the
same time as the request is being processed. Thus, after I looked
at how non-Ozone/X11 handle selection notify, copy the logic that
SelectionRequestor::OnSelectionNotify has and complete
the request with empty data.

Fixes the following tests:
SafeBrowsingBlockingPageWithDelayedWarningsBrowserTest/SafeBrowsingBlockingPageDelayedWarningBrowserTest.Paste_*

Bug: 1084472
Change-Id: Iad7383f198b482549c9cff7f6b1183c9b8419470
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2340909Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
Commit-Queue: Maksim Sisov (GMT+3) <msisov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#796709}
parent a55e6a9c
......@@ -241,6 +241,13 @@ bool X11ClipboardOzone::OnSelectionNotify(
.Run(selection_state.data);
}
return true;
} else if (static_cast<x11::Atom>(event.property) == x11::Atom::None &&
selection_state.request_clipboard_data_callback) {
// If the remote peer could not send data in the format we requested,
// or failed for any reason, we will send empty data.
std::move(selection_state.request_clipboard_data_callback)
.Run(selection_state.data);
return true;
}
return false;
......
Markdown is supported
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