slint-ui/slint · error
unable to show popup window
Error message
unable to show popup window
What it means
Slint panics when the window adapter refuses to make a popup window visible during `show_popup`. Popup windows are created internally when a component declares `show_popup`; the backend's `set_visible(true)` returned an Err, meaning the platform window could not be mapped/shown. This indicates a backend or platform-level failure, not a Slint API misuse.
Solutions
- Verify the parent window is still visible and mapped before calling show_popup
- Check the backend/platform supports top-level popups (winit backend with multi-window support) rather than a limited embedded backend
- Update to a newer Slint version; popup handling across backends has changed over releases
- Reproduce with the `testing` backend to see if it is backend-specific
Example fix
// before: showing a popup after window closed
window.show_popup(popup, position);
// after: guard on visibility/valid window
if window.is_visible() {
window.show_popup(popup, position);
} Defensive patterns
Strategy: validation
Validate before calling
if !window.is_visible() { return; } // do not show popups on hidden windows
// plus: only call show_popup on backends with window support
Type guard
fn can_show_popup(w: &slint::Window) -> bool { w.is_visible() } Prevention
- Never call show_popup after closing the parent window
- Test popup flows on your target backend (embedded backends may not support top-level popups)
- Pin to a Slint release where popup behavior on your platform is known-good
When it happens
Trigger: Calling `show_popup` (or triggering it via a property/touch event) when the backend window adapter's `set_visible` fails — e.g. the underlying platform window was already destroyed, the display/connection is gone, or the backend does not support separate top-level popup windows.
Common situations: Running on embedded/backends without real multi-window support; showing a popup after the parent window was closed; Wayland/X11 connection lost; Android activity in background state.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- context shouldn't have been set before
- Popup component is a Window item
- It must be there because we set the global
- slint_testing_use_native_popup called without testing…
- window_adapter just initialized above
AI-assisted analysis of slint-ui/slint@3a7e700487 (2026-09-16).
Data as JSON: /api/errors/cae42effa3e768ca.
Report an issue: GitHub.
Appendix: source
Thrown at internal/core/window.rs:2161
&clip_region,
);
self.window_adapter().request_redraw();
(
PopupWindowLocation::ChildWindow(rect.origin),
Box::pin(PropertyTracker::new_with_dirty_handler(
PopupWindowPropertiesTracker {
parent_window_adapter_weak: parent_window_adapter_weak.clone(),
popup_id,
},
)),
)
} else {
let popup_window = popup_window_adapter.window();
WindowInner::from_pub(popup_window).set_component(popup_componentrc);
popup_window.set_position(LogicalPosition::from_euclid(position));
popup_window.set_size(WindowSize::Logical(LogicalSize::from_euclid(size)));
popup_window_adapter.set_visible(true).expect("unable to show popup window");
(
PopupWindowLocation::TopLevel(popup_window_adapter),
Box::pin(PropertyTracker::new_with_dirty_handler(
PopupWindowPropertiesTracker {
parent_window_adapter_weak: parent_window_adapter_weak.clone(),
popup_id,
},
)),
)
};
let focus_item = if matches!(window_kind, WindowKind::ToolTip) {
Default::default()
} else {
self.take_focus_item(&FocusEvent::FocusOut(FocusReason::PopupActivation))
.map(|item| item.downgrade())
.unwrap_or_default()
};View on GitHub (pinned to 3a7e700487)