Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Linux: checkbox item Uncheck doesn't work in submenu #72

@nohajc

Description

@nohajc

When I try to programmatically deselect a checkbox menu item (call Uncheck), it doesn't work if the menu item is part of a submenu.

I wrote a minimal example reproducing the issue. Basically, I wanted to emulate radio button group behavior which means only one item can be selected at a time and I need to deselect the previous selection without any associated input event.

While it works correctly in the root menu, it breaks when I use the same logic for submenu items.
The clicked item gets selected but the state of the others in the group doesn't change.

Here's the demonstration (tested in KDE):
https://github.com/nohajc/systray-issue-minimal-example

Thanks for any help.

BTW, I also wanted to submit a PR adding support for actual radio buttons (which are part of the dbusmenu interface) but I got stuck because of this issue. D-Bus basically only lets you select the type of the "tick" icon. It doesn't enforce any particular behavior so multiselect is still possible unless you add your own logic. Now, I believe my logic is correct but I was very surprised to see it doesn't work consistently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS:LinuxOnly occurs on Linux/Unix systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions