Opened 7 years ago

Last modified 3 weeks ago

#1887 reopened defect

modify behavior to disable gnome-screensaver

Reported by: da_audiophile@… Owned by: reimar
Priority: normal Component: core
Version: unspecified Severity: major
Keywords: Cc: nalimilan@…, oliver.henshaw@…
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no


Using the poke command to disable gnome-screensaver in one's ~/.mplayer/config does not work any more.

cat ~/mplayer/config | grep heart
heartbeat-cmd="gnome-screensaver-command -p > /dev/null" # for gnome-screensaver

See the following gnome bugreport wherein the gnome-screensaver devs recommend "Ask mplayer and co. people to fix their app to use the Inhibit interface on the SessionManager? object. Poke was only supposed to be a temporary transition to using Inhibit and well we know how temporary goes sometimes. :)"

Change History (7)

comment:1 Changed 7 years ago by reimar

  • Resolution set to wontfix
  • Status changed from new to closed

MPlayer will _not_ implement gnome-specific stuff. Unless the gnome developers get their act together and support at least one gnome-independent method gnome will not be supported. This is _final_.
It is ridiculous to expect every single application to support your special way that in addition is changed at least once a year, we will not play along with these incompetent games of "look, we came up with a new idiocy to waste your time with".

comment:2 Changed 7 years ago by reimar

Ok, and to also be a bit helpful, by what I have found this wrapper script should work:

gnome-screensaver-command -i -n MPlayer -r "Playing" &
mplayer "$@"
kill -9 $cmdpid

comment:3 Changed 5 years ago by nalimilan@…

  • Resolution wontfix deleted
  • Status changed from closed to reopened,

I'm reopening this bug because GNOME has just done the first part of the move by supporting the org.freedesktop.ScreenSaver?.Inhibit() and .UnInhibit?() D-Bus calls that are used by KDE for a long time[1]. Thus, there now exist one good cross-desktop solution to inhibit the screensaver.

This addition was done after a discussion with VLC developers[1], and they will likely use it in the future[2]. It would probably make sense for MPlayer too.


comment:4 Changed 5 years ago by reimar

Well, that's still only gnome and KDE, and it requires a completely new dbus dependency for which we'd have no other use than disabling the screensaver.
In addition the only C binding (except for pulling in the whole glib) starts the documentation with this: "If you use this low-level API directly, you're signing up for some pain."
It is at least some progress though.
Even though an improved command-line tool like xdg-screensaver would have been less pain to support.
Don't expect me personally to work on it though.

comment:5 Changed 5 years ago by nalimilan@…

Well, Linux desktop users all use D-Bus anyway, so that does not add any new dependency for them, and of course you would not enable D-Bus on other platforms. And this interface might become more than KDE+GNOME since a new specification proposal is being discussed on the XDG list[1].

Also, libdbus is not that fun to use, but for such simple calls as Inhibit() and UnInhibit?(), that does not really matter. The command-line tool was discussed with VLC devs[2], and it has its own drawbacks too.


comment:6 Changed 5 years ago by oliver.henshaw@…

  • Cc oliver.henshaw@… added

comment:7 Changed 3 weeks ago by bathus

  • Analyzed by developer unset
  • Reproduced by developer unset

Here's another wrapper in the spirit of reimar's, because gnome-screensaver-command isn't used by default in modern Gnome. It sets org.gnome.desktop.session.idle-delay to 0 until mplayer exits, which prevents screen locking.

delay=`gsettings get org.gnome.desktop.session idle-delay | cut -d ' ' -f 2`
gsettings set org.gnome.desktop.session idle-delay '0'
mplayer "$@"
gsettings set org.gnome.desktop.session idle-delay "${delay}"
Note: See TracTickets for help on using tickets.