Bug 466108 - Quickly clicking "Show All Installed Apps" repeatedly in the app chooser makes it confuse states
Summary: Quickly clicking "Show All Installed Apps" repeatedly in the app chooser make...
Status: RESOLVED FIXED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 5.27.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-19 21:50 UTC by Ilya Bizyaev
Modified: 2023-03-03 22:24 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Bizyaev 2023-02-19 21:50:00 UTC
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
Comment 1 Bug Janitor Service 2023-02-21 06:54:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/166
Comment 2 Harald Sitter 2023-02-21 12:56:48 UTC
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.
Comment 3 Bug Janitor Service 2023-02-28 11:34:30 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/170
Comment 4 Harald Sitter 2023-03-03 22:24:50 UTC
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