Bug 404468 - Closing down laptop's lid suspends laptop even when there is something playing
Summary: Closing down laptop's lid suspends laptop even when there is something playing
Status: RESOLVED NOT A BUG
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.15.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-17 08:53 UTC by Matej Mrenica
Modified: 2019-02-21 15:08 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matej Mrenica 2019-02-17 08:53:38 UTC
STEPS TO REPRODUCE
1. Set 'action when laptops lid is closed' to 'suspend (to RAM)'
2. Start youtube video in a browser (Firefox or Chromium)

OBSERVED RESULT
You can see media controls appear and also a message in powerdevil applet(?),
that Chromium/Firefox 'suppresses power management because there is a video playing'. 
But when you close the laptop lid, laptop goes to sleep.

Sidenote: Media playback in Chromium or Firefox is very often not recognised, in that case it is understandable that laptop goes to sleep.
This could be solved by 'suppressesing power management' anytime media controls are active.
But when testing this it was recognised correctly and it didn't help anyway.

EXPECTED RESULT
Laptop doesn't go to sleep when there is a video or audio playing.

SOFTWARE/OS VERSIONS
KDE Frameworks Version: 5.55
Qt Version: 5.12.1

ADDITIONAL INFORMATION
On wayland,
I have 'pause music when going to sleep(?)' disabled because it used to un-pause already paused music when going to sleep.
Comment 1 Matej Mrenica 2019-02-17 16:41:41 UTC
Also happens with qbittorent, which is not related to media playback.
Comment 2 Kai Uwe Broulik 2019-02-19 08:13:45 UTC
It's the application's responsibility to prevent suspend when it's doing something. However, closing the lid *always* suspends the machine since it's an explicit user ineraction just like pressing the Sleep button.

This is to avoid the user closing the lid, expecting the machine to suspend, and then putting it in a bag where it may overheat because an app decided to keep the machine on.
Comment 3 Matej Mrenica 2019-02-21 15:08:12 UTC
(In reply to Kai Uwe Broulik from comment #2)
> It's the application's responsibility to prevent suspend when it's doing
> something. However, closing the lid *always* suspends the machine since it's
> an explicit user ineraction just like pressing the Sleep button.
> 
> This is to avoid the user closing the lid, expecting the machine to suspend,
> and then putting it in a bag where it may overheat because an app decided to
> keep the machine on.

But it works on Xorg though...