knapsu / plex-media-player-appimage

Linux AppImage packages for Plex Media Player application.
https://knapsu.eu/plex/
GNU General Public License v3.0
93 stars 13 forks source link

Not keeping screen awake [Debian 9 Gnome] #25

Closed spooknik closed 4 years ago

spooknik commented 5 years ago

On my laptop the app is not keeping the screen awake while media is playing. It would be a nice feature to have.

Linouxs commented 5 years ago

Same problem on Linux Mint 19.1 Cinnamon

probonopd commented 5 years ago

https://people.freedesktop.org/~hadess/idle-inhibition-spec/re01.html

tyjuji commented 4 years ago

Since PMP is broken on the AUR because of Qt issues, I had to see if AppImage was working. Of course AppImage due to its nature works just fine, but I see this issue still persists.

I had a look into what was going on with it and I see that the Plex repo implements two ways to inhibit the screensaver. xdg-screensaver and org.freedesktop.ScreenSaver using D-Bus.

https://github.com/plexinc/plex-media-player/blob/master/src/power/PowerComponentX11.cpp does not seem to use xdg-screensaver at all, but I'm not that familiar with Qt. If it works at all, I'd like to know which distros it works for.

https://github.com/plexinc/plex-media-player/blob/master/src/power/PowerComponentDBus.cpp uses the method @probonopd referenced.

The version that is used is determined by an option at compile time, so you can't use both in an AppImage as I understand it. In https://forums.plex.tv/t/plex-media-player-packages-for-linux/198091/24 the use of -DLINUX_X11POWER=on was suggested and has likely been set ever since.

So I forked this repo and built using the travis.yml as a guide without the -DLINUX_X11POWER=on switch set in scripts/build.sh. This was successful and works fine on my machine running Manjaro and KDE Plasma. It shows in the same place as Firefox does, when it plays a video.

Unless the X11 power management is necessary on other distros I'd suggest turning off the option for good and thus allow the D-Bus method to be used. Otherwise, there is perhaps cause to distribute 2 versions of the AppImage.

As a temporary workaround, I've uploaded the resulting AppImage here: https://github.com/tyjuji/plex-media-player-appimage/releases

knapsu commented 4 years ago

Hi @tyjuji Thank you very much for this comprehensive report.

I lived with conviction that D-Bus and X11 are used for power management. Your findings showed that I was wrong. I have screensavers disabled on all my machines so I did not see the issue myself.

Can not say which distributions needed the X11 method. It might be that it is not required any more simply because the problem with their D-Bus packages got resolved.

For me apps should first focus on compatibility standards like XDG so if I have to choose between those two I would definitely prioritize D-Bus method, especially X11 is becoming obsolete with Wayland behind the corner.

I've removed -DLINUX_X11POWER=on from the build script.