Skip to content

Calling PopupWindow show() in a init callback causes "Recursion Detected" panics #9498

@NigelBreslaw

Description

@NigelBreslaw

This code panics: (Recursion detected)

component Demo { 
    popup := PopupWindow {  }
    init => popup.show();
}

(at least on slintpad)

Original Bug Description

See the example below. Not only does it not work the entire WASM side of slintpad seems to have locked up. You cannot open/close the console.

Reproducible Code (if applicable)

Visit
https://snapshots.slint.dev/master/editor/?lib=material=https://raw.githubusercontent.com/slint-ui/slint/refs/heads/master/ui-libraries/material/material.slint

Then paste the following example


import { ModalNavigationDrawer } from "@material";
export component Example inherits Window {
    width: 400px;
    height: 300px;
    // background: transparent;
    init => {
        debug("hi");
        mdf.show();
    }
    mdf := ModalNavigationDrawer {
        width: 280px;
        height: parent.height;
        groups: [
            {
                title: "Main",
                items: [
                    { icon: @image-url("../icons/share.svg"), text: "Home" },
                    { icon: @image-url("../icons/search.svg"), text: "Search" }
                ]
            }
        ];
    }
}

Environment Details

  • Slint Version:
  • Platform/OS:
  • Programming Language:
  • Backend/Renderer:

Product Impact

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    need triagingIssue that the owner of the area still need to triage

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions