Joystick activity does not stop the screensaver

Bug #30378 reported by PeterShinners
This bug affects 22 people
Affects Status Importance Assigned to Milestone
GNOME Screensaver
gnome-screensaver (Ubuntu)
xscreensaver (Ubuntu)

Bug Description

While playing games entirely with the joystick the screensaver is activated every few minutes.

Input activity from a joystick should have the same results as activity from the mouse or keyboard.

Revision history for this message
Miguel Martinez (el-quark) wrote :

I cannot currently test this, as I have currently no joystick available. However, I'd like to add that if you are moving only the mouse wheel, the screensaver will also activate. This behaviour was also present in Breezy (I don't remember if it was in Hoary)

Revision history for this message
Clinton (cjljt) wrote :

running Dapper 6.06 on Toshiba Tecra 8100. Have also noticed that USB connected mouse will not terminate screensaver. Laptop hardware mouse will.

Revision history for this message
Emmet Hikory (persia) wrote :

Unfortunately, gnome-screensaver checks the X event queue to determine when an event occurs, and most joystick using programs in ubuntu use the kernel event interface (or legacy /dev/js0) from libsdl.

Regarding the mouse scroll, there is a limitation in X that only one client may trap button clicks at a time, so gnome-screensaver must ignore them in order to allow the program to see them. This is also annoying upstream (see src/gs-watcher-x11.c for the rant).

Changed in gnome-screensaver:
status: Unconfirmed → Confirmed
Revision history for this message
danslinuxbox (danslinuxbox) wrote :

This screensaver bug is still present G.Gibbon, I found it while player sauerbraten using both mouse and keyboard. disabling the screensaver is necessary.

I used to use Debian with Gnome and I didn't have this problem. If anyone is interested I still have my old debian partition and can check the difference if you tell me what to look for.


Changed in gnome-screensaver:
status: Unknown → New
Revision history for this message
enigma_0Z (enigma-0za) wrote :

Just wanted to add a "me too". This is quite annoying, is there some kind of workaround?

Revision history for this message
Hooya (tjbassoon) wrote :

I would also like a fix/workaround to solve this issue. Even a screenlet switch would be useful at this point.

Revision history for this message
Mathieu Comandon (strycore) wrote :

if you wish to script this you can add gnome-screensaver-command -i to your game launchers to inhibit the screen saver .
I have yet to find a way to stop this command when the game quits

Changed in gnome-screensaver:
status: New → Invalid
Revision history for this message
quequotion (quequotion) wrote :

So this was never concluded. Why did it become "Invalid"?

Did someone mistake this for a discussion of the problems with the mouse wheel?

I suppose it is more of a feature request than a bug, but why couldn't the screensaver notice input from joystics? (especially now that more programs are using events to control the input and there should be some way to hotwire the sdl input anyway).

Revision history for this message
Emmet Hikory (persia) wrote :

The upstream task has become invalid because upstream has determined that the best workaround is for joystick using applications to inhibit screensaver activation directly. In the unlikely event that all games are ported to use the X joystick interface, it may be appropriate to revisit the behaviour of gnome-screensaver in the presence of joystick activity.

For reference, joystick using applications that use SDL are expected to not activate the screensaver any longer, due to changes in SDL ( ). Applications not using SDL should call XResetScreensaver as appropriate to avoid screensaver activation.

Note also that the effects of such changes may be unobserved if some changes to xsync ( ) are not included in the running X server.

I am marking this bug against Ubuntu gnome-screensaver also invalid, for the same reasoning. Those experiencing this issue are encouraged to file new bugs against the joystick using packages which fail to inhibit screensaver activiation. For example, if the behaviour with sauerbraten mentioned in comment #4 can be reproduced with a recent Ubuntu release, a bug should be filed against sauerbraten.

Changed in gnome-screensaver (Ubuntu):
status: Confirmed → Invalid
Changed in gnome-screensaver:
importance: Unknown → Medium
status: Invalid → Unknown
Changed in gnome-screensaver:
status: Unknown → Invalid
Revision history for this message
Chris Cowan (macil) wrote :

I'm on Ubuntu 12.04, and each of the Steam for Linux games I've played that support gamepads don't seem to inhibit the screensaver themselves. I don't know if it's realistic to expect them to all patch to deal with this themselves, and I'm not sure the responsibility should be on them.

Revision history for this message
Stephan Sokolow (ssokolow) wrote :

@10: It shouldn't. Expecting every game, past present and future (including closed-source ones where the developers bundled a copy of everything except libc and libGL to avoid having to maintain them) to special-case joysticks on Linux is insanity.

This disagreement over approach reminds me of a Buddhist quote.

“Where would I find enough leather
To cover the entire surface of the earth?
But with leather soles beneath my feet,
It’s as if the whole world has been covered.”

Even if that weren't the case, ignoring the joystick is architecturally wrong. The X server is supposed to reset the screensaver counter on INPUT. Joysticks are input. (And they're not typically used for the special "Let's control the music player without waking the monitors" case which justifies LIRC also being an exception.)

Anyway, since the xf86-input-joystick driver can watch the joystick without blocking other applications, I've just e-mailed the upstream developer/maintainer to ask whether it's possible to use it to map joystick input to the X11 input queue in a way which would have no effect beyond being visible to the screensaver subsystem.

Changed in gnome-screensaver (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Daniel Ellis (danellisuk) wrote :

I have tested this and can confirm the issue still remains on both Ubuntu 12.04 and 14.04, so marking as confirmed. The technical reasons behind the current behaviour do not cause the issue at hand to become invalid. Upstream may have marked this as invalid, but this remains an Ubuntu issue, and this bug should remain confirmed until a suitable work around is found for Ubuntu.

Revision history for this message
Daniel Ellis (danellisuk) wrote :

Agree whole heartedly with Stephan Sokolow. We need a way to have the X server handle the joystick without having it send the mapped events to other applications. Was there any response from upstream?

For now, here is how you can enable the joystick within the X server:-

sudo apt-get install xserver-xorg-input-joystick

This creates the file /usr/share/X11/xorg.conf.d/50-joystick.conf

Now to disable the mouse integration, and create a mapping of the buttons so they all behave as shift keys, edit the file to look as follows:-

Section "InputClass"
        Identifier "joystick catchall"
        MatchIsJoystick "on"
        MatchDevicePath "/dev/input/event*"
        Driver "joystick"
        Option "StartKeysEnabled" "True"
        Option "StartMouseEnabled" "False"
        Option "MapButton1" "key=50"
        Option "MapButton2" "key=50"
        Option "MapButton3" "key=50"
        Option "MapButton4" "key=50"

Now pressing any of the four mains buttons will prevent the screensaver from appearing. Although, this will not work for any games that you only use the direction pads on. I think most games involve button presses, so hopefully this is a practical solution for people until a proper solution is available.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xscreensaver (Ubuntu):
status: New → Confirmed
Revision history for this message
Straximus (straximus) wrote :

Adding xscreensaver as an affected package, as it exhibits the same behavior as gnome-screensaver in this regard.

Revision history for this message
Forest (foresto) wrote :

I wrote a program called joystickwake to work around this problem until display servers learn that joysticks are input devices. If you happen to be running Ubuntu Trusty, you can install it from my PPA:

Revision history for this message
Christian Mertes (cmertes) wrote :

Dammit, I missed the tenth birthday of this incredibly annoying bug. Anyway, belated happy birthday!

Revision history for this message
quequotion (quequotion) wrote :

I think danellisuk's approach is interesting. I wonder if there is any "null" key they could be redirected to?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.