Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt backend: Escape does not close PopupWindow #7332

Closed
ubruhin opened this issue Jan 11, 2025 · 3 comments · Fixed by #7356
Closed

Qt backend: Escape does not close PopupWindow #7332

ubruhin opened this issue Jan 11, 2025 · 3 comments · Fixed by #7356
Labels
a:backend-qt The Qt backend - including the qt style (mO,bS) bug Something isn't working

Comments

@ubruhin
Copy link
Contributor

ubruhin commented Jan 11, 2025

Bug Description

The escape key should close a PopupWindow. It does with winit and WASM, but nothing happens with the Qt backend.

Reproducible Code (if applicable)

export component AppWindow inherits Window {
    width: 100px;
    height: 100px;

    popup := PopupWindow {
        Rectangle {
            background: yellow;
        }

        x: 10px;
        y: 10px;
        height: 50px;
        width: 50px;
    }


    TouchArea {
        clicked => {
            popup.show();
        }
    }
}

Environment Details

  • Slint Version: 1.9.1
  • Platform/OS: Linux
  • Backend/Renderer: Qt

Product Impact

No response

@ubruhin ubruhin added bug Something isn't working need triaging Issue that the owner of the area still need to triage labels Jan 11, 2025
@ogoffart ogoffart added a:backend-qt The Qt backend - including the qt style (mO,bS) and removed need triaging Issue that the owner of the area still need to triage labels Jan 11, 2025
@ogoffart
Copy link
Member

Thanks for the bug report. I can reproduce.

@ogoffart
Copy link
Member

The problem is that with the Qt backend, the key event are processed on the WindowInner for the PopupWindow (the winit backend don't create separate window for this)
So the self in this line

let close_on_escape = if let Some(popup) = self.active_popups.borrow().last() {
is the popup window itself and therefore doesn't have child popup to close.

@tronical
Copy link
Member

Interesting, so perhaps active_popups should be Rc and shared?

ogoffart added a commit that referenced this issue Jan 13, 2025
With the Qt backend, the PopupWindow has it's own Window, so we need to
make sure we close the popup on the right Window

Fixes #7332
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:backend-qt The Qt backend - including the qt style (mO,bS) bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants