Open
Description
Bug Description
Hi all,
-
What are the bugs?
- A popup cannot be opened from a context menu if that menu is not closed before calling
popup.show()
[line 43]. - A popup cannot be opened from another popup if the first one is not closed before calling
popup2.show()
[line 30].
- A popup cannot be opened from a context menu if that menu is not closed before calling
-
What behaviour did I expect, and what happened instead?
- Maybe the context menu should close itself automatically after a click?
- The second popup should display correctly even if opened from another popup.
-
Any error messages or logs, if available.
qt.qpa.wayland: Creating a popup with a parent, QWidgetWindow(0x5ff6b1570850, name="QWidgetClassWindow") which does not match the current topmost grabbing popup, QWidgetWindow(0x5ff6b154bb50, name="QWidgetClassWindow") With some shell surface protocols, this is not allowed. The wayland QPA plugin is currently handling it by setting the parent to the topmost grabbing popup. Note, however, that this may cause positioning errors and popups closing unxpectedly. Please fix the transient parent of the popup.
-
Steps to reproduce the issue
Just execute the attached code with Qt set as backend.I've also made a repository with the exact configuration I used.
-
Suggestions
I've worked with Qt for some time and this behaviour could well be more a "feature" than a bug, or at least I can remember something similar. If that is the case, I would add a sort of a warning in the docs.
Thanks
Reproducible Code (if applicable)
import { Button } from "std-widgets.slint";
export component App inherits Window {
preferred-width: 700px;
preferred-height: 500px;
popup2 := PopupWindow {
width: root.width / 2;
height: root.height / 2;
Rectangle {
background: Colors.green;
Text {
text: "Text";
}
}
}
popup := PopupWindow {
width: root.width / 2;
height: root.height / 2;
Rectangle {
background: Colors.red;
Button {
text: "Open second popup";
clicked => {
// The following line must be uncommented to show the second popup
//popup.close();
popup2.show();
}
}
}
}
context_menu := ContextMenuArea {
Menu {
MenuItem {
title: "Open popup";
activated => {
// The following line must be uncommented to show the first popup
//context_menu.close();
popup.show();
}
}
}
}
Button {
text: "Show context menu";
clicked => {
context_menu.show(self.absolute-position);
}
}
}
Environment Details
- Slint Version: 1.12.1
- Platform/OS: Arch Linux
- Programming Language: Rust
- Backend/Renderer: Qt v6.9.0.1
Product Impact
No response