Bug 469370 - Hibernate button even though unable to hibernate
Summary: Hibernate button even though unable to hibernate
Status: RESOLVED DOWNSTREAM
Alias: None
Product: kscreenlocker
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: 5.27.4
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-04 22:55 UTC by gbug222222
Modified: 2024-09-25 16:19 UTC (History)
2 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 gbug222222 2023-05-04 22:55:13 UTC
SUMMARY
***
There is a button to hibernate on the lock screen even if the hibernation function is not possible due to insignificant swap space.
***

STEPS TO REPRODUCE
1. Create an installation with a swap file smaller than your ram.

OBSERVED RESULT
Hibernate button is on lock screen.

EXPECTED RESULT
Hibernate button isn't on lock screen.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.27.4
KDE Framworks Version: 5.105.0
Qt Version: 5.15.9
Kernal Version: 6.2.13-arch1-1 (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
When the hibernate button is clicked, the screen fades to black. After about 15 seconds, whenever you click the screen returns to the lock screen.
Comment 1 Nate Graham 2023-05-15 20:53:29 UTC
The hibernate button appears when your system has hibernation enabled. But it's the system's responsibility to make sure that everything is set up correctly for hibernation to actually work--either your distro, or you (if you're using a DIY distro).
Comment 2 php4fan 2024-09-25 14:57:08 UTC
> The hibernate button appears when your system has hibernation enabled

Enabled where?
Comment 3 Nate Graham 2024-09-25 15:01:54 UTC
On the row with the Sleep and Switch User buttons.
Comment 4 php4fan 2024-09-25 15:58:11 UTC
> On the row with the Sleep and Switch User buttons.

I'm not sure whether I'm not understanding your answer or you didn't understand my question.

You said:

> The hibernate button appears *when your system has hibernation enabled*

My question is: when the system has hibernation enabled where? Where is the system setting that enables hibernation?
Comment 5 Nate Graham 2024-09-25 16:00:56 UTC
The way Hibernation is set up is outside of the scope of KDE; this is generally done at the installation step, and requires an appropriately sized swap partition. It's not something you can just turn on with a switch, AFAIK.
Comment 6 php4fan 2024-09-25 16:19:30 UTC
> The way Hibernation is set up is outside of the scope of KDE; this is generally done at the installation step, and requires an appropriately 
> sized swap partition. It's not something you can just turn on with a switch, AFAIK.

Ok, but you seemed to imply that KDE checks somewhere to see whether or not hibernation is "enabled" in the system. This is what you said:

> The hibernate button appears *when your system has hibernation enabled*

So:

A) If you are not checking at all, and are just displaying a Hibernate button no matter what (but that doesn't seem to be what you said), then I think you should do better than that. You say it's someone else's responsibility to make sure that hibernation works, and that's true, but that might be just impossible on some systems, and it _is_ your responsibility to not show a Hibernate button that fakes hibernation if hibernation is not available at all (unless someone else is lying to you as per point C).

B) If you are supposedly checking whether hibernation is available, i.e. working, you are not doing it correctly, because it's not on my system and yet you show the button

C) If you are checking somewhere that hibernation is enabled (which is what I seemed to understand from the sentence I've quoted for the third time), then you would probably be right that it's not KDE's fault if some other piece of the system has enabled hibernation without making sure it can work. Which is why I'm asking WHERE you are checking whether it's enabled, so that I can report the bug to whoever is responsible for that.