Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GTK4] Ensure that clipboard read operations work synchronously
https://bugs.webkit.org/show_bug.cgi?id=265088 Reviewed by NOBODY (OOPS!). Often clipboard operations are triggered as a result of a button press event, which is handled with synchronous messages between web and UI process. However, GTK4 clipboard reads are asynchronous, and this can easily cause deadlocks when the UI process is both waiting for the press event to be handled by the web process before returning to the main loop and the GTK4 clipboard is waiting for the GAsyncReadyCallback to read from its stream at the same time, before allowing WebKit's pasteboard to finish and let the press event to finish being handled. This explains why many of the GTK4 pasteboard and clipboard tests are currently timing out -- the UI process is in a deadlock state. This deadlock can be prevented by using a GMainLoop to make sure that the GTK Clipboard will call the GAsyncReadyCallback for the clipboard operation in time, without deadlocking. * Source/WebKit/UIProcess/gtk/ClipboardGtk4.cpp: (WebKit::ReadTextAsyncData::ReadTextAsyncData): (WebKit::Clipboard::readText): (WebKit::ReadBufferAsyncData::ReadBufferAsyncData): (WebKit::Clipboard::readBuffer):
- Loading branch information