Comment 44 for bug 428884

Revision history for this message
Chris Coulson (chrisccoulson) wrote : Re: gnome-screensaver --poke functionality does no longer inhibit screen blanking

"gnome-screensaver-command --poke" uses the SimulateUserActivity() method on the org.gnome.ScreenSaver interface. I was referring specifically to the Inhibit() and Uninhibit() methods in my previous comment (sorry, I should have been more clear). If applications are going to be ported to using the inhibit interface (rather than SimulateUserActivity), then they need to be ported to the gnome-session interface, which is less problematic

I can set aside some time to take a look at this patch. Initially, I thought there might be a nicer and less hacky way of doing this, but this doesn't seem to be the case. The problem of trying to reset the IDLETIME counter to prevent the session from being set to idle is not a new problem, and gnome-session currently uses some hackery to manipulate the counter by simulating fake key presses.

I tried manipulating IDLETIME directly usin XSyncSetCounter, but X doesn't let you do that.

So, it seems that there is currently no nice way of acheiving this functionality (in the ideal world, applications would use the inhibit interface instead, rather than simulating fake user activity). If the patch above works, then it would just need to be made more robust by calling XScreenSaverQueryExtension() before doing any other XSS extension calls.

Alternatively, you can look to the send_fake_event() function in gs-idle-monitor.c in the gnome-session source.