Skip to content

Bug Report: First Session Item Disappears When Selected in Dropdown #68

@yuzujr

Description

@yuzujr

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.

Image Image

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

  1. Launch SDDM in test mode: sddm-greeter-qt6 --test-mode --theme /path/to/sddm-astronaut-theme/
  2. Ensure the first session in the list is currently selected (default behavior)
  3. Click on the session dropdown to open it
  4. Observe that the first item is missing (invisible, not clickable)
  5. Select any other session and reopen the dropdown
  6. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions