From 4a66bf98ca3c8bb8a40ffe0063b13ba3bd2f8416 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 22 Feb 2018 20:55:03 -0800 Subject: [PATCH] "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. --- src/clipboard/x11.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/clipboard/x11.rs b/src/clipboard/x11.rs index 0acd6a107..e538336c8 100644 --- a/src/clipboard/x11.rs +++ b/src/clipboard/x11.rs @@ -282,7 +282,6 @@ impl ClipboardImpl { selprop, // the disposition from the operation above ), ); - self.conn.flush(); } xcb::MAPPING_NOTIFY => { // 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)) { Err(RecvTimeoutError::Timeout) => continue, @@ -307,7 +307,6 @@ impl ClipboardImpl { Ok(ClipRequest::SetClipboard(clip)) => { self.owned = clip; self.update_owner(); - self.conn.flush(); } Ok(ClipRequest::RequestClipboard) => { // Find the owner and ask them to send us the buffer @@ -319,9 +318,9 @@ impl ClipboardImpl { self.atom_xsel_data, xcb::CURRENT_TIME, ); - self.conn.flush(); } } + self.conn.flush(); } } }