mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-21 01:49:44 +00:00
read the clipboard asynchronously
getClipboardText() used to open a pipe, ask the selection owner for the text and poll it with a 500 ms deadline, so every paste blocked the UI thread (TextBox calls it directly) and a slow owner meant a visible hang. The selection is now fetched in the background: when the selection changes, the backend requests the text into a non-blocking pipe and getClipboardText() only returns the buffer, which the event loop fills in as the data arrives. Pasting no longer blocks, and a source that never answers simply leaves the previous buffer in place. Also clears the advertised MIME list when a new selection offer arrives, so a request is never made with MIME types of a previous owner.
This commit is contained in:
parent
6a5e485bca
commit
d9794afa67
3 changed files with 42 additions and 23 deletions
|
|
@ -212,6 +212,7 @@ void on_display_error() {
|
|||
}
|
||||
|
||||
void WaylandInput::pollEvents(bool waitForRefresh) {
|
||||
updateClipboard();
|
||||
beginFrame();
|
||||
dispatch(waitForRefresh);
|
||||
if (window) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue