{"record":{"id":"8a7b246651b16dfa","repo":"zed-industries/zed","slug":"failed-to-initialize-window-refresh-timer","errorCode":null,"errorMessage":"Failed to initialize window refresh timer","messagePattern":"Failed to initialize window refresh timer","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_linux/src/linux/x11/client.rs","lineNumber":2028,"sourceCode":"                            let force_render = std::mem::take(\n                                &mut window.window.state.borrow_mut().force_render_after_recovery,\n                            );\n                            let window = window.window.clone();\n                            drop(state);\n                            window.refresh(RequestFrameOptions {\n                                require_presentation: false,\n                                force_render,\n                            });\n                        }\n                        xcb_connection\n                    };\n                    client.process_x11_events(&xcb_connection).log_err();\n\n                    // Take into account that some frames have been skipped\n                    let now = Instant::now();\n                    while instant < now {\n                        instant += refresh_rate;\n                    }\n                    calloop::timer::TimeoutAction::ToInstant(instant)\n                }\n            })\n            .expect(\"Failed to initialize window refresh timer\")\n    }\n\n    fn get_cursor_icon(&mut self, style: CursorStyle) -> Option<xproto::Cursor> {\n        if let Some(cursor) = self.cursor_cache.get(&style) {\n            return *cursor;\n        }\n\n        let result = 'outer: {\n            let mut errors = String::new();\n            let cursor_icon_names = cursor_style_to_icon_names(style);\n            for cursor_icon_name in cursor_icon_names {\n                match self\n                    .cursor_handle\n                    .load_cursor(&self.xcb_connection, cursor_icon_name)","sourceCodeStart":2010,"sourceCodeEnd":2046,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_linux/src/linux/x11/client.rs#L2010-L2046","documentation":"The X11 client sets up a periodic refresh timer for redraws; failure to insert the calloop timer source panics because without it frames would not be refreshed (presentation/refresh bookkeeping breaks). Typically caused by event-loop registration failure or fd exhaustion.","triggerScenarios":"Thrown at crates/gpui_linux/src/linux/x11/client.rs:2014 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the calloop handle validity and ulimit -n for fd exhaustion","Inspect the calloop error for the concrete cause","Fall back to event-driven redraws instead of a fixed refresh timer"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}