Bug 426645 - Grayed-out non-functional "Save Session" and/or "Hibernate" actions appear on Leave page
Summary: Grayed-out non-functional "Save Session" and/or "Hibernate" actions appear on...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Launcher (Kickoff) (show other bugs)
Version: 5.19.90
Platform: Neon Linux
: VHI normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-09-17 16:52 UTC by Patrick Silva
Modified: 2020-10-07 18:56 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.20


Attachments
screenshot (343.61 KB, image/png)
2020-09-17 16:52 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2020-09-17 16:52:36 UTC
Created attachment 131724 [details]
screenshot

SUMMARY
My system can not hibernate because I have no swap partition/file,
but "Hibernate" option is available in kickoff and kicker launchers anyway.
The attached screenshot shows kickoff.

EXPECTED RESULT
Hde "Hibernate" option when hibernation is not supported

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.19.90
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.0
Comment 1 Nate Graham 2020-09-18 21:12:56 UTC
I see from your screenshot that the option is slightly grayed out. Is it disabled, or can you click on it. If you do, what happens?
Comment 2 Patrick Silva 2020-09-18 21:20:18 UTC
Nothing happens when I click on it.
Same thing on Arch Linux running Plasma 5.20 beta.
Comment 3 Nate Graham 2020-09-18 21:44:43 UTC
Thanks. I guess by being grayed out, it seems to understand that it'snot supported, but something must have regressed recently to make it get displayed. I also notice that you have a grayed out "Save Session" item, which I notice I have too (shows you how often I open Kickoff's Leave page lol)
Comment 4 Nate Graham 2020-09-24 17:30:46 UTC
This was caused by https://invent.kde.org/plasma/plasma-workspace/-/commit/05414ed58d43d87d907326636faac53ae2e7bd and https://invent.kde.org/plasma/plasma-desktop/-/commit/59ac49ace991ffb3ffaf1a24013aca9aaad8b123

Technically this change was intentional, though arguably it was therefore a questionable idea. :) Making these items disabled instead of hidden doesn't really work since they still have a hover effect and are clickable, so they just look broken. Even if we fix that, it will still be odd to have non-interactive entries in those UIs.

Just changing enabled: to visible: won't work since the items will still take up space in the UI. I think we need to remove them from the model, or add a proxy model that filters them out or something.
Comment 5 Bug Janitor Service 2020-10-07 18:31:34 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/336
Comment 6 Eike Hein 2020-10-07 18:54:40 UTC
Git commit fcdbbda3965d73900c415071ad882f550994fdc2 by Eike Hein.
Committed on 07/10/2020 at 18:37.
Pushed by hein into branch 'master'.

[kicker] Don't add invalid actions to the system action model

The system actions model recently changed behavior to always present all
possible actions, with `AbstractEntry::isValid` driving the model role
`Kicker::DisabledRole` so that views can e.g. grey out unavailable
actions.

This was perceived as a regression by users who are annoyed at e.g.
`Hibernate` being visible when their system setup precludes it more or
less permanently.

This patch reverts this behavior.

Note that the dynamic approach we had permanently wasn't very great
anyway, as the associated favorites models would remove entries when
they became invalid, and they wouldn't come back automatically when the
entry were to become valid again. In effect that means when you added one
of these actions to e.g. the Kicker sidebar and it became unavailable
it would disappear until re-added anyways.

I can imagine use cases where dynamic behavior would be useful to have -
let's say disabling Shutdown/Reboot while a critical system update is
being performed. But in that case we'd need to fix the favorites
behavior and add some way to inform the user why the action is disabled
for a good user experienced anyhow.

M  +32   -23   applets/kicker/plugin/systemmodel.cpp
M  +3    -1    applets/kicker/plugin/systemmodel.h

https://invent.kde.org/plasma/plasma-workspace/commit/fcdbbda3965d73900c415071ad882f550994fdc2
Comment 7 Nate Graham 2020-10-07 18:55:35 UTC
Git commit d80f738fc7ebb8c1324e0c75e433b319a8e13aef by Nate Graham, on behalf of Eike Hein.
Committed on 07/10/2020 at 18:55.
Pushed by ngraham into branch 'Plasma/5.20'.

[kicker] Don't add invalid actions to the system action model

The system actions model recently changed behavior to always present all
possible actions, with `AbstractEntry::isValid` driving the model role
`Kicker::DisabledRole` so that views can e.g. grey out unavailable
actions.

This was perceived as a regression by users who are annoyed at e.g.
`Hibernate` being visible when their system setup precludes it more or
less permanently.

This patch reverts this behavior.

Note that the dynamic approach we had permanently wasn't very great
anyway, as the associated favorites models would remove entries when
they became invalid, and they wouldn't come back automatically when the
entry were to become valid again. In effect that means when you added one
of these actions to e.g. the Kicker sidebar and it became unavailable
it would disappear until re-added anyways.

I can imagine use cases where dynamic behavior would be useful to have -
let's say disabling Shutdown/Reboot while a critical system update is
being performed. But in that case we'd need to fix the favorites
behavior and add some way to inform the user why the action is disabled
for a good user experienced anyhow.


(cherry picked from commit fcdbbda3965d73900c415071ad882f550994fdc2)

M  +32   -23   applets/kicker/plugin/systemmodel.cpp
M  +3    -1    applets/kicker/plugin/systemmodel.h

https://invent.kde.org/plasma/plasma-workspace/commit/d80f738fc7ebb8c1324e0c75e433b319a8e13aef