-
-
Notifications
You must be signed in to change notification settings - Fork 173
Description
Description
When opening the session selection dropdown and the first session (index 0) is currently selected, that first item disappears from the list (the item is not visible, not clickable, and has no hover effect, but the empty space remains). Selecting any other session works normally.
Environment
- OS: Arch Linux
- Kernel: 6.17.4-arch2-1
- SDDM Version: 0.21.0-6
- Qt Version: 6.10.0
- Theme: sddm-astronaut-theme (latest version from master branch)
- Architecture: x86_64
Steps to Reproduce
- Launch SDDM in test mode:
sddm-greeter-qt6 --test-mode --theme /path/to/sddm-astronaut-theme/ - Ensure the first session in the list is currently selected (default behavior)
- Click on the session dropdown to open it
- Observe that the first item is missing (invisible, not clickable)
- Select any other session and reopen the dropdown
- Now all items are visible
Root Cause
The issue is caused by using selectSession.delegateModel in the ListView's model property. Qt ComboBox's delegateModel is designed to exclude the currently selected item from the dropdown list. This is the default behavior of ComboBox - it assumes the selected item is already shown in the button and doesn't need to appear in the dropdown again.
Solution
Replace selectSession.delegateModel with selectSession.model in the ListView, and handle the delegate and click events manually.
I can submit a Pull Request with this fix if needed. Please let me know if you would like me to do so.