{"record":{"id":"cae42effa3e768ca","repo":"slint-ui/slint","slug":"unable-to-show-popup-window","errorCode":null,"errorMessage":"unable to show popup window","messagePattern":"unable to show popup window","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/core/window.rs","lineNumber":2065,"sourceCode":"                    &clip_region,\n                );\n                self.window_adapter().request_redraw();\n                (\n                    PopupWindowLocation::ChildWindow(rect.origin),\n                    Box::pin(PropertyTracker::new_with_dirty_handler(\n                        PopupWindowPropertiesTracker {\n                            parent_window_adapter_weak: parent_window_adapter_weak.clone(),\n                            popup_id,\n                        },\n                    )),\n                )\n            } else {\n                let popup_window = popup_window_adapter.window();\n                WindowInner::from_pub(popup_window).set_component(popup_componentrc);\n                popup_window.set_position(LogicalPosition::from_euclid(position));\n                popup_window.set_size(WindowSize::Logical(LogicalSize::from_euclid(size)));\n\n                popup_window_adapter.set_visible(true).expect(\"unable to show popup window\");\n                (\n                    PopupWindowLocation::TopLevel(popup_window_adapter),\n                    Box::pin(PropertyTracker::new_with_dirty_handler(\n                        PopupWindowPropertiesTracker {\n                            parent_window_adapter_weak: parent_window_adapter_weak.clone(),\n                            popup_id,\n                        },\n                    )),\n                )\n            };\n\n        let focus_item = if matches!(window_kind, WindowKind::ToolTip) {\n            Default::default()\n        } else {\n            self.take_focus_item(&FocusEvent::FocusOut(FocusReason::PopupActivation))\n                .map(|item| item.downgrade())\n                .unwrap_or_default()\n        };","sourceCodeStart":2047,"sourceCodeEnd":2083,"githubUrl":"https://github.com/slint-ui/slint/blob/3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016/internal/core/window.rs#L2047-L2083","documentation":"When a PopupWindow (ComboBox menu, context menu, tooltip) opens and the backend created a dedicated popup window adapter, Slint calls WindowAdapter::set_visible(true) on it; the .expect('unable to show popup window') turns any Err from the platform layer into a panic. The failure comes from the windowing system - mapping the real (top-level) popup window failed - not from application markup; the same popup usually works once the display/GPU environment is healthy.","triggerScenarios":"Opening any PopupWindow when the winit backend tries to create a real OS popup window and the request fails: lost/broken X11 or Wayland connection, compositor rejecting the xdg_popup (invalid parent surface or position), GPU context/surface creation failure, or running headless with no display server at all.","commonSituations":"Headless CI running UI tests without Xvfb/weston; X-forwarding or remote desktop sessions with limited extensions; GPU driver reset while a menu was open; experimental backends with incomplete popup support; VMs without 3D acceleration.","solutions":["Provide a real display: run UI tests under xvfb-run (X11) or a headless weston compositor.","If GPU-related, force the software renderer, e.g. SLINT_BACKEND=winit-software (or renderer-software feature), and update GPU drivers/mesa.","Ensure the event loop and parent window exist on the same (main) thread before anything triggers popups.","Reproduce with a minimal PopupWindow example and report it with backend/renderer and SLINT_DEBUG_LOG=1 output if the environment is healthy."],"exampleFix":"# before: headless CI, opening a ComboBox menu panics 'unable to show popup window'\ncargo test --test ui\n\n# after: give the backend a display (or force software rendering)\nxvfb-run -a cargo test --test ui\n# alternatively: SLINT_BACKEND=winit-software cargo test --test ui","handlingStrategy":"try-catch","validationCode":"// Cheap pre-flight before triggering popups: the parent window must\n// still be shown on a live windowing connection.\nif !window.is_visible() {\n    // re-show or abort before opening the popup\n}","typeGuard":null,"tryCatchPattern":"// The panic fires inside popup show (e.g. ComboBox activation);\n// isolate user-triggered popup entry points on flaky display setups:\nlet r = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {\n    ui.invoke(\"open-the-popup\", &Default::default());\n}));\nif r.is_err() {\n    log::error!(\"popup window could not be shown: display/GPU problem\");\n}","preventionTips":["Run headless UI tests under xvfb-run or a headless weston compositor","Prefer the software renderer on VMs and CI (SLINT_BACKEND=winit-software)","Keep GPU drivers/mesa current on desktop targets","Reproduce with SLINT_DEBUG_LOG=1 and report recurring popup-show failures upstream"],"tags":["popup","window","panic","winit","wayland","headless"],"backgroundTag":"window-creation-failed","analyzedSha":"3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016","analyzedAt":"2026-08-19T23:23:16.610Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}