zed-industries/zed · error

Failed to initialize window refresh timer

Error message

Failed to initialize window refresh timer

What it means

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.

Source

Thrown at crates/gpui_linux/src/linux/x11/client.rs:2028

                            let force_render = std::mem::take(
                                &mut window.window.state.borrow_mut().force_render_after_recovery,
                            );
                            let window = window.window.clone();
                            drop(state);
                            window.refresh(RequestFrameOptions {
                                require_presentation: false,
                                force_render,
                            });
                        }
                        xcb_connection
                    };
                    client.process_x11_events(&xcb_connection).log_err();

                    // Take into account that some frames have been skipped
                    let now = Instant::now();
                    while instant < now {
                        instant += refresh_rate;
                    }
                    calloop::timer::TimeoutAction::ToInstant(instant)
                }
            })
            .expect("Failed to initialize window refresh timer")
    }

    fn get_cursor_icon(&mut self, style: CursorStyle) -> Option<xproto::Cursor> {
        if let Some(cursor) = self.cursor_cache.get(&style) {
            return *cursor;
        }

        let result = 'outer: {
            let mut errors = String::new();
            let cursor_icon_names = cursor_style_to_icon_names(style);
            for cursor_icon_name in cursor_icon_names {
                match self
                    .cursor_handle
                    .load_cursor(&self.xcb_connection, cursor_icon_name)

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Check the calloop handle validity and ulimit -n for fd exhaustion
  2. Inspect the calloop error for the concrete cause
  3. Fall back to event-driven redraws instead of a fixed refresh timer
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/gpui_linux/src/linux/x11/client.rs:2014 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/8a7b246651b16dfa. Report an issue: GitHub.