Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Usage of org.freedesktop.ScreenSaver for generic idle inhibit on Wayland? #9275

Closed
Mershl opened this issue Oct 5, 2021 · 4 comments
Labels

Comments

@Mershl
Copy link

Mershl commented Oct 5, 2021

Description

Latest mpv is reporting "GNOME's wayland compositor lacks support for the idle inhibit protocol. This means the screen can blank during playback." while running on GNOME wayland.

MP_WARN(wl, "GNOME's wayland compositor lacks support for the idle inhibit protocol. This means the screen can blank during playback.\n");

Other apps started using the org.freedesktop.ScreenSaver interface as an generic way to support idle inhibit. Could this also be a candidate for mpv?

@Mershl Mershl added the os:linux label Oct 5, 2021
@CounterPillow
Copy link
Contributor

CounterPillow commented Oct 5, 2021

mpv will not add support for dbus garbage.

There's an open MR on GNOME's side for the non-dbus-garbage method of idle inhibition: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/111

@Mershl Mershl closed this as completed Oct 5, 2021
@Deminder
Copy link

Deminder commented Jan 5, 2022

Until that MR is done this might be useful to some other flatpak users: (besides myself 🙂 )
I wrote a lua script as a workaround using gnome-session-inhibit to only inhibit when unpaused. This is for the io.mpv.Mpv flatpak app but this can be easily adapted for non-flatpak as well.

flatpak override --user --talk-name=org.gnome.SessionManager io.mpv.Mpv && curl -o ~/.var/app/io.mpv.Mpv/config/mpv/scripts/inhibit-screensaver.lua https://gist.githubusercontent.com/Deminder/6839fad736865cb3acabab409f9b09a1/raw/5c7d606733074aed8de3e542743229852fc34337/inhibit-with-heartbeat.lua

(this is better than just blindly inhibiting with an alias as suggested in #7713)

@ssokolow
Copy link

ssokolow commented Mar 4, 2022

For the record, I downvoted the "dbus garbage" comment because I'm a KDE+MPV user who refuses to install "GNOME garbage".

The D-Bus API is intended to be a cross-desktop standard (that's why it begins with org.freedesktop.) and I don't want Zenity vs. KDialog vs. etc. all over again... let alone the state of things in X11, where it's a total crapshoot.

(I have to manually turn off screensaver inhibiting in a specialized MPV wrapper for playing stuff I fall asleep to or my tool for tracking my sleep cycle can't tell real activity apart from MPV's faked input events.)

@redhat421
Copy link

I ran into this same issue on KDE under Wayland on Fedora 39. KDE didn't notice a video playing in mpv and thus didn't trigger presentation mode.

I forked a version of mpv-freedesktop-screensaver-plugin.c and added it as an mpv plugin. This worked perfectly to inhibit power management and the screensaver / lock.

I thinking of packaging up the plugin and distributing it like mpv-mpris.

P.S. mpv is super great! Thanks for the hard (and often thankless) work maintaining such an excellent player. :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants