SUMMARY As a result, only the recommended apps are shown when the button is toggled on, and vice versa. Repeating the trick re-aligns the states. SOFTWARE/OS VERSIONS Operating System: openSUSE Leap 15.4 KDE Plasma Version: 5.27.0 KDE Frameworks Version: 5.103.0 Qt Version: 5.15.8 Kernel Version: 5.14.21-150400.24.46-default (64-bit) Graphics Platform: Wayland ADDITIONAL INFORMATION
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/166
This is giving me a headache. What happens is that we handle onClicked but if you click quickly enough the second click issues onDoubleClicked. The state confusion then occurs because clicks directly influence the checked state (though I have to admit I don't understand how. More specifically it appears the following happens for single click: - click - onCheckedChanged - onClicked - checked binding reevaluates For a double click it is: - click - click - onCheckedChanged - onClicked - checked binding reevaluates - onCheckedChanged (the result of the second click) - onDoubleClick What I don't quite get is how the checked state can be directly manipulated while also being a binding. I'd either expect the binding to break or onCheckedChanged to not get emitted on clicks (without first running onClicked). I think this needs further investigation. The fix at face value would be to not have checked be a binding and instead of onclicked react to oncheckedchanged but that also seems a bit weird.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/170
Git commit 207c96aaeaf448c9a8c77f52e809611c6e5763cd by Harald Sitter. Committed on 03/03/2023 at 22:04. Pushed by sitter into branch 'master'. don't react on clicks for checkable buttons clicked is distinct from doubleclicked and not the correct handler to use for checkable buttons because of that. use toggle instead. M +1 -3 src/AppChooserDialog.qml https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/207c96aaeaf448c9a8c77f52e809611c6e5763cd