Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
linux: Fix panic missing screen mode for crtc specified mode ID (#9106)
Vitor Ramos3bd9d1442080
diff --git a/crates/gpui/src/platform/linux/x11/client.rs b/crates/gpui/src/platform/linux/x11/client.rsindex e3dd1628fe8..ddae8cbb315 100644--- a/crates/gpui/src/platform/linux/x11/client.rs+++ b/crates/gpui/src/platform/linux/x11/client.rs@@ -314,19 +314,19 @@ impl Client for X11Client {.xcb_connection.send_request(&xcb::randr::GetScreenResourcesCurrent { window: x_window });let screen_resources = self.xcb_connection.wait_for_reply(cookie).expect("TODO");- let crtc = screen_resources.crtcs().first().expect("TODO");-- let cookie = self.xcb_connection.send_request(&xcb::randr::GetCrtcInfo {- crtc: crtc.to_owned(),- config_timestamp: xcb::x::Time::CurrentTime as u32,- });- let crtc_info = self.xcb_connection.wait_for_reply(cookie).expect("TODO");-- let mode_id = crtc_info.mode().resource_id();let mode = screen_resources- .modes()+ .crtcs().iter()- .find(|m| m.id == mode_id)+ .find_map(|crtc| {+ let cookie = self.xcb_connection.send_request(&xcb::randr::GetCrtcInfo {+ crtc: crtc.to_owned(),+ config_timestamp: xcb::x::Time::CurrentTime as u32,+ });+ let crtc_info = self.xcb_connection.wait_for_reply(cookie).expect("TODO");++ let mode_id = crtc_info.mode().resource_id();+ screen_resources.modes().iter().find(|m| m.id == mode_id)+ }).expect("Missing screen mode for crtc specified mode id");let refresh_event_token = self