Bug 378906 - Ktorrent disables automatic screen lock
Summary: Ktorrent disables automatic screen lock
Status: ASSIGNED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Kubuntu Linux
: NOR major
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-18 08:24 UTC by Ofnuts
Modified: 2023-02-06 18:11 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ofnuts 2017-04-18 08:24:38 UTC
In System settings>Desktop behavior>Screen locking, I set a time-out of 2mn. I leave the system alone and lock-up doesn't happen after 2mn.

Then I remember I have Ktorrent running with the "Prevent going to sleep" option. I quit ktorrent, wait 2mn, and the screen locks up. Some more trials show that screen lock up doesn't happen if ktorrent is downloading and ktorrent "Prevent sleep" option is set.

Screen lock-up occurs if either

* ktorrent is not running
* ktorrrent has no active torrent
* ktorrent "prevent sleep" option is not set

I do appreciate the usefulness of the "Prevent sleep" option, but it shouldn't interfere with screen lockup. This is a security issue. 

I made my experiments with ktorrent, but it is unlikely that ktorrent explicitly prevents lock-up, so this would be an unwanted coupling of the "Prevent sleep" function and other applications could have the same problem.

Version of the component is hard to tell... Running KDE from Kubuntu 16.04 which seems to be KDE Framework 5.18, while System Settings report v5.5.5.
Comment 1 Rex Dieter 2017-04-18 14:25:28 UTC
As far as I know, the "Prevent going to sleep" option makes no distinction between the 2 you mention (system sleep vs screen sleep), ie, you cannot have one without th other
Comment 2 Martin Flöser 2017-04-18 14:52:49 UTC
Reassign to ktorrent - not a bug in kscreenlocker
Comment 3 Ofnuts 2017-04-20 20:10:55 UTC
(In reply to Rex Dieter from comment #1)
> As far as I know, the "Prevent going to sleep" option makes no distinction
> between the 2 you mention (system sleep vs screen sleep), ie, you cannot
> have one without th other

I'm not talking about screen sleep but about screen lock which is a different functionality...
Comment 4 Rex Dieter 2017-04-21 14:56:10 UTC
OK, in this case, I'm still not sure there's any distinction between screen lock vs screen sleep
Comment 5 Ofnuts 2017-04-22 09:33:13 UTC
IMHO these are three very different purposes. I understand that applications such as ktorrent want to prevent the machine from going to sleep (which would interrupt their job) but screen lock/sleep is none of their business,  they can run in a locked-up machine.

Screen lock and sleep serve also different purpose, you may want to turn off the screen without locking the machine (which requires entering password).
Comment 6 Andrius Štikonas 2017-12-10 14:16:46 UTC
I looked at KTorrent code. It seems that only mediaplayer inhibits screensaver. So you can just disable mediaplayer plugin and Screensaver shoudln't be inhibited.
Comment 7 Ofnuts 2017-12-10 18:36:51 UTC
My only enabled plugin in the Information Widget.
Comment 8 Patrick Silva 2018-01-20 17:12:05 UTC
Confirmed on Arch Linux.
plasma 5.12 beta
ktorrent 5.1.0

Automatic screen locking does not work if some torrent is active.
mediaplayer plugin is not enabled here.
Comment 9 Valerii Malov 2018-03-13 13:34:18 UTC
I get the impression that this is related more to kscreenlocker than ktorrent, because kscreenlocker doesn't seem to differentiate between screensaver inhibition and power management inhibition:

https://github.com/KDE/kscreenlocker/commit/39152af231d2c76163699ba8e99228f40c46f269

Because screen saver interface is considered obsolete (I guess?), so media players use power management inhibition to inhibit the screen locker. Which means that ktorrent has no way of inhibiting suspend without inhibiting screen locker. In the end it seems to be an FDO spec issue (or lack of thereof).
Comment 10 Wedge009 2021-08-05 13:30:41 UTC
Amazing! I stumbled upon this report looking for something else, but I've also had this problem ever since I started using KDE on my primary machine, around January 2020. I've always just manually locked my screen instead - but it does indeed appear that KTorrent is blocking screen locking for me. I always wondered why screen locking didn't work only on a particular machine (the one where KTorrent is running).

The way KTorrent describes the option (as of version 5.1.2) is 'Suppress sleep when torrents are running'. I took that to mean avoid putting the system/PC to sleep/suspend while KTorrent is running in the background. As the prior discussion mentions, this sleep/suspend (at least from a user perspective) doesn't seem like it should be related at all to screen locking or power saving.
Comment 11 Rex Dieter 2021-08-05 13:47:18 UTC
See comment #1 , currently the protocol makes no distinction between strict powersaving and screen locking (I'm venture most folks wouldn't want their machine to go to sleep while sharing either?)
Comment 12 Rex Dieter 2021-08-05 13:49:31 UTC
So I guess moral of the story, if you don't want this bahavior either:
* manually lock your screen
and/or
* disable ktorrent's "prevent sleep" option
Comment 13 Wedge009 2021-08-05 13:58:52 UTC
For the sake of clarity, perhaps the description of the option in KTorrent could be updated to refer to screen locking and/or power saving as well as 'sleep'? Clearly I'm not the only one who would assume they are separate, even if the system currently treats all of them as the same. Just trying to be constructive here.
Comment 14 Andrius Štikonas 2021-08-05 14:00:03 UTC
(In reply to Wedge009 from comment #13)
> For the sake of clarity, perhaps the description of the option in KTorrent
> could be updated to refer to screen locking and/or power saving as well as
> 'sleep'? Clearly I'm not the only one who would assume they are separate,
> even if the system currently treats all of them as the same. Just trying to
> be constructive here.

Sounds reasonable. Can you prepare a patch? Should be quite simple as this is just a string change.
Comment 15 Wedge009 2021-08-05 14:30:48 UTC
Apologies if I've done anything wrong or missed something I'm supposed to do, I haven't really worked with GitLab before...

https://invent.kde.org/network/ktorrent/-/merge_requests/45
Comment 16 Wedge009 2021-08-06 01:15:51 UTC
As discussed in the merge request, I'm unable to make any changes in my fork of KTorrent, I think I broke something in GitLab. Someone else will have to make the change. (sigh)
Comment 17 Andrius Štikonas 2021-08-06 22:31:25 UTC
Git commit e076cef975c10a20029e32b89808a88032c37e3d by Andrius Štikonas.
Committed on 06/08/2021 at 22:31.
Pushed by stikonas into branch 'master'.

Clarify message about screensaver inhibition.

Commit originally done by Wedge009.

M  +2    -2    ktorrent/pref/generalpref.ui

https://invent.kde.org/network/ktorrent/commit/e076cef975c10a20029e32b89808a88032c37e3d
Comment 18 Bug Janitor Service 2022-07-01 06:15:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/ktorrent/-/merge_requests/61
Comment 19 Gabriel Barros 2023-02-06 18:11:05 UTC
i think everyone agrees that having an option to prevent sleep, but still locking the screen is the most desirable and common sense option.

Can we open a blocker ticket on KScreenLocker(?) to have this alternative? I'm not familiar with the current KDE ecosystem to understand where the new blocker should live, but happy to do the leg work after i'm pointed in the right direction.