1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-27 12:23:46 +03:00

"centralize" conn.flush()

I've noticed a bit of sluggishness when pasting text from the
terminal and into chrome.  This doesn't fix it, but it moves
things a bit closer to how they should be.
This commit is contained in:
Wez Furlong 2018-02-22 20:55:03 -08:00
parent 6bf691947d
commit 4a66bf98ca

View File

@ -282,7 +282,6 @@ impl ClipboardImpl {
selprop, // the disposition from the operation above selprop, // the disposition from the operation above
), ),
); );
self.conn.flush();
} }
xcb::MAPPING_NOTIFY => { xcb::MAPPING_NOTIFY => {
// Nothing to do here; just don't want to print an error // Nothing to do here; just don't want to print an error
@ -296,6 +295,7 @@ impl ClipboardImpl {
} }
}, },
} }
self.conn.flush();
match self.receiver.recv_timeout(Duration::from_millis(100)) { match self.receiver.recv_timeout(Duration::from_millis(100)) {
Err(RecvTimeoutError::Timeout) => continue, Err(RecvTimeoutError::Timeout) => continue,
@ -307,7 +307,6 @@ impl ClipboardImpl {
Ok(ClipRequest::SetClipboard(clip)) => { Ok(ClipRequest::SetClipboard(clip)) => {
self.owned = clip; self.owned = clip;
self.update_owner(); self.update_owner();
self.conn.flush();
} }
Ok(ClipRequest::RequestClipboard) => { Ok(ClipRequest::RequestClipboard) => {
// Find the owner and ask them to send us the buffer // Find the owner and ask them to send us the buffer
@ -319,9 +318,9 @@ impl ClipboardImpl {
self.atom_xsel_data, self.atom_xsel_data,
xcb::CURRENT_TIME, xcb::CURRENT_TIME,
); );
self.conn.flush();
} }
} }
self.conn.flush();
} }
} }
} }