Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

gpui_linux: Drain buffered X11 events after foreground work (#62081)

mTvaref4178619acd0
diff --git a/crates/gpui_linux/src/linux/x11/client.rs b/crates/gpui_linux/src/linux/x11/client.rs
index e9dd8f6a8f7..6ba8583ce6f 100644
--- a/crates/gpui_linux/src/linux/x11/client.rs
+++ b/crates/gpui_linux/src/linux/x11/client.rs
@@ -321,12 +321,15 @@ impl X11Client {
// Insert the runnables as idle callbacks, so we make sure that user-input and X11
// events have higher priority and runnables are only worked off after the event
// callbacks.
- handle.insert_idle(|_| {
+ handle.insert_idle(|client| {
let location = runnable.metadata().location;
let spawned = runnable.metadata().spawned;
profiler::update_running_task(spawned, location);
runnable.run();
profiler::save_task_timing();
+
+ let xcb_connection = client.0.borrow().xcb_connection.clone();
+ client.process_x11_events(&xcb_connection).log_err();
});
}
}
diff --git a/crates/gpui_linux/src/linux/x11/window.rs b/crates/gpui_linux/src/linux/x11/window.rs
index 94037067e71..f9423a38ee5 100644
--- a/crates/gpui_linux/src/linux/x11/window.rs
+++ b/crates/gpui_linux/src/linux/x11/window.rs
@@ -1521,14 +1521,6 @@ impl PlatformWindow for X11Window {
message,
)
.log_err();
- self.0
- .xcb
- .set_input_focus(
- xproto::InputFocus::POINTER_ROOT,
- self.0.x_window,
- xproto::Time::CURRENT_TIME,
- )
- .log_err();
xcb_flush(&self.0.xcb);
}