{"record":{"id":"fccd5f956a79ba89","repo":"slint-ui/slint","slug":"internal-error-accesskit-adapter-must-exist-when-window","errorCode":null,"errorMessage":"internal error: accesskit adapter must exist when window exists","messagePattern":"internal error: accesskit adapter must exist when window exists","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backends/winit/winitwindowadapter.rs","lineNumber":1284,"sourceCode":"    pub(crate) fn dispatch_winit_window_event(\n        &self,\n        event_loop: &ActiveEventLoop,\n        winit_window: &winit::window::Window,\n        event: WinitWindowEvent,\n    ) -> Result<(), PlatformError> {\n        if let Some(mut window_event_filter) = self.window_event_filter.take() {\n            let event_result = window_event_filter(self.window(), &event);\n            self.window_event_filter.set(Some(window_event_filter));\n\n            match event_result {\n                EventResult::PreventDefault => return Ok(()),\n                EventResult::Propagate => (),\n            }\n        }\n\n        #[cfg(enable_accesskit)]\n        self.accesskit_adapter()\n            .expect(\"internal error: accesskit adapter must exist when window exists\")\n            .borrow_mut()\n            .process_event(winit_window, &event);\n\n        let runtime_window = WindowInner::from_pub(self.window());\n        self.maybe_set_custom_cursor(event_loop, winit_window);\n        if !matches!(\n            event,\n            WinitWindowEvent::CursorMoved { .. } | WinitWindowEvent::AxisMotion { .. }\n        ) {\n            self.shared_backend_data.flush_pending_mouse_move();\n        }\n\n        match event {\n            WinitWindowEvent::RedrawRequested => self.draw()?,\n            WinitWindowEvent::Resized(size) => {\n                let resized = self.resize_event(size);\n\n                // Entering fullscreen, maximizing or minimizing the window will","sourceCodeStart":1266,"sourceCodeEnd":1302,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/internal/backends/winit/winitwindowadapter.rs#L1266-L1302","documentation":"When the accesskit feature is enabled, every winit window adapter is expected to hold an accesskit adapter as long as the winit window exists. `accesskit_adapter()` returning `None` during event processing breaks this invariant and panics.","triggerScenarios":"Processing a winit event for a window whose adapter's accesskit adapter was never created or already torn down - e.g. events arriving for a window being destroyed, or an internal ordering bug between window creation/destruction and event dispatch.","commonSituations":"Window closed/destroyed while events are still queued in the event loop; accessibility tooling (screen readers) triggering event delivery during teardown; race between adapter removal and pending events.","solutions":["Update to the latest slint version (teardown races are often fixed upstream)","Avoid programmatically destroying windows while pumping the event loop from nonstandard paths","If reproducible, file a bug with a minimal reproducer - this is an internal invariant violation"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"std::panic::catch_unwind(|| window.handle().dispatch_event(event))\n    .map_err(|_| anyhow!(\"accesskit event delivered during window teardown\"))?;","preventionTips":["Avoid destroying windows while events are still queued in the event loop","Keep slint up to date; teardown races are fixed upstream","If reproducible with a screen reader attached, file a minimal reproducer upstream"],"tags":["accesskit","accessibility","winit","panic"],"backgroundTag":"internal-invariant-violation","analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}