6

so i have upgraded to Ubuntu 12.10 and i installed smplayer from the repositories. The thing is when i play a movie (even in full screen) the screen saver comes up. I have to disable screensaver enabled in smplayer but it doesn't seem to work

apt-cache policy mplayer
mplayer:
  Installed: 2:1.0~rc4.dfsg1+svn34540-1ubuntu2
  Candidate: 2:1.0~rc4.dfsg1+svn34540-1ubuntu2
  Version table:
 *** 2:1.0~rc4.dfsg1+svn34540-1ubuntu2 0
        500 http://pt.archive.ubuntu.com/ubuntu/ quantal/universe amd64 Packages
        100 /var/lib/dpkg/status

apt-cache policy gnome-screensaver
gnome-screensaver:
  Installed: 3.6.0-0ubuntu2
  Candidate: 3.6.0-0ubuntu2
  Version table:
 *** 3.6.0-0ubuntu2 0
        500 http://pt.archive.ubuntu.com/ubuntu/ quantal-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.6.0-0ubuntu1 0
        500 http://pt.archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages

Any ideas?

psychok7
  • 523

4 Answers4

4

The -p option doesn't exist anymore.

Its a bug in gnome-screensaver. http://lists.mplayerhq.hu/pipermail/mplayer-users/2012-November/085566.html

3

first install xdotool Then add to mplayer config or comand line

heartbeat-cmd="xdotool key shift"

This will send shift key press and release as code above but using xdotool.

AkhIL
  • 31
1

I am not sure whether smplayer reads ~.mplayer/config, but you need to

sudo apt-get install libxtst-dev

(maybe more, I had some developement packages already installed)

paste this into a file called sendXshift.c

/* program to send shift-down, shift-up through X test extension to indicate that the X session isn't idle */

#include <stdio.h>
#include <stdlib.h>

#include <X11/Xlib.h>
#include <X11/extensions/Xext.h>
#include <X11/extensions/XTest.h>

int main(){
  Display *dpy;
  Status stat;
  int i1,i2,i3,i4;
  Bool stat1;`

  dpy = XOpenDisplay(NULL);

  if (dpy == NULL){
    printf("open display failed\n");
    exit(1);
  }

  stat1 = XTestQueryExtension(dpy,&i1,&i2,&i3,&i4);
  if (stat1 == 0){
printf("Xtest not supported\n");
XCloseDisplay(dpy);
exit(1);
  }
  // shift down:
  XTestFakeKeyEvent(dpy,0x32,True,CurrentTime);
  // shift up:
  XTestFakeKeyEvent(dpy,0x32,False,CurrentTime);

  XCloseDisplay(dpy);


}

And compile with cc -o sendXshift sendXshift.c -lX11 -lXtst, make it executable and then put heartbeat-cmd="/PATH/TO/COMPILED/FILE/sendXshift".

This should do until/if http://bugzilla.mplayerhq.hu/show_bug.cgi?id=1887 isi solved.

sup
  • 4,964
0

My guess is this: gnome-screensaver removed the "poke" argument.

Mplayer however tries to poke the screensaver via

heartbeat-cmd="gnome-screensaver-command -p"

and fails.

I'm not sure how to proceed, setting the hearbeat command to

heartbeat-cmd="gnome-screensaver-command --exit"

would disable the screensaver for the whole session.

It may be best to install xscreensaver instead. Or use DBUS to inhibit the screensaver. For gnome-shell there are extensions to pause the screensaver manually.

ko-dos
  • 6,288
  • 1
  • 14
  • 3