After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 335831 - does not stop the session going idle when just scrollwheel is used
does not stop the session going idle when just scrollwheel is used
Status: RESOLVED FIXED
Product: gnome-screensaver
Classification: Deprecated
Component: daemon
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-screensaver maintainers
gnome-screensaver maintainers
Depends on:
Blocks:
 
 
Reported: 2006-03-24 12:28 UTC by Richard Hughes
Modified: 2006-04-04 14:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
watch for user time changes on windows (1.13 KB, patch)
2006-04-02 03:57 UTC, Ray Strode [halfline]
committed Details | Review

Description Richard Hughes 2006-03-24 12:28:01 UTC
When I'm reading a document in firefox or evince, I just use the scroll-down scrollwheel to read the document. After the delay I've set in g-s-p, the screen dims as g-p-m thinks that the session is idle. This is wrong.

I guess the fix is to monitor the scroll events as well as the mouse move and button events.

Tell me what extra info you need.

Thanks,

Richard.
Comment 1 William Jon McCann 2006-03-24 15:09:53 UTC
I remember now.  Here's one of the comments (from jwz) in gs-watcher-x11.c:

        /* Select for SubstructureNotify on all windows.
           Select for KeyPress on all windows that already have it selected.

           Note that we can't select for ButtonPress, because of X braindamage:
           only one client at a time may select for ButtonPress on a given
           window, though any number can select for KeyPress.  Someone explain
           *that* to me.

           So, if the user spends a while clicking the mouse without ever moving
           the mouse or touching the keyboard, we won't know that they've been
           active, and the screensaver will come on.  That sucks, but I don't
           know how to get around it.

           Since X presents mouse wheels as clicks, this applies to those, too:
           scrolling through a document using only the mouse wheel doesn't
           count as activity...  Fortunately, /proc/interrupts helps, on
           systems that have it.  Oh, if it's a PS/2 mouse, not serial or USB.
           This sucks!
        */
Comment 2 Richard Hughes 2006-03-24 16:51:09 UTC
Ok, thanks for the info. I love X! Is it worth asking the X.org guys for some input (heh) on this?
Comment 3 Ray Strode [halfline] 2006-03-27 07:39:50 UTC
I imagine only one client can select for ButtonPress because when X gets a buttonpress event it implicitly grabs the pointer (until button release or an explict XGrabPointer).

We should probably push for XIDLE to get added to Xorg.

One random thought...Can we watch for _NET_WM_USER_TIME changes to work around this?  Modern toolkits should update that property, I believe, when the user clicks/scrolls anyway.
Comment 4 William Jon McCann 2006-03-27 16:33:24 UTC
for reference here's the xidle bug:
https://bugs.freedesktop.org/show_bug.cgi?id=1419
Comment 5 William Jon McCann 2006-03-28 17:53:07 UTC
xidle, as it stands, doesn't really seem ideal to me.  We really don't want to have to poll.  Using a signal/event based approach seems much more useful - especially for noticing activity during the activation warning period.

Also, the suggestions in that bug that it should be possible to "feed back" information into the server seems really odd to me.  If you regard X11 input as just one source of input then there is really no need to inject information into the server.  It seems the motivation for this is to handle the screen is locked case.  I think it makes more sense to define idle policy and state outside the Xserver.


Comment 6 William Jon McCann 2006-03-28 17:58:31 UTC
Unless I'm missing something obvious, this sounds perfect:
http://freedesktop.org/wiki/Software/XEvIE
Comment 7 William Jon McCann 2006-03-31 18:34:21 UTC
A quick test showed that using libXevie with an xorg server with XEVIE enabled detects these events nicely.
Comment 8 Richard Hughes 2006-03-31 18:43:30 UTC
Yay, I guess most distros compile XEVIE into xorg? FC5 sure does.
Comment 9 William Jon McCann 2006-03-31 18:49:31 UTC
However, it is off by default.  And it seems like some versions only support one client using it at a time.  So, this will obviously have to be optional support.
Comment 10 William Jon McCann 2006-03-31 20:21:08 UTC
Actually, it looks like the multiple client support may never have been completed.  Ray, do you about its status?
Comment 11 Ray Strode [halfline] 2006-03-31 20:34:07 UTC
No idea.
Comment 12 Ray Strode [halfline] 2006-03-31 20:34:40 UTC
Soeren might know though, adding to CC list.
Comment 13 Ray Strode [halfline] 2006-04-02 03:57:32 UTC
Created attachment 62583 [details] [review]
watch for user time changes on windows

Hey Richard,

Does something like the above fix things for you?  I don't have a scroll wheel so I can't test.
Comment 14 Richard Hughes 2006-04-02 08:58:33 UTC
Yes Ray, that patch works as required. When I'm scrolling through a document in evince, I get:

[_gs_watcher_notice_activity] gs-watcher-x11.c:569 (09:58:07):   Activity detected: resetting timers
[remove_idle_timer] gs-watcher-x11.c:464 (09:58:07):     killing idle_timer  (60000, 208)
[add_idle_timer] gs-watcher-x11.c:477 (09:58:07):        starting idle_timer (50000, 209)
[_gs_watcher_check_pointer_position] gs-watcher-x11.c:1404 (09:58:07):   Idle 0 seconds

and the screen no longer dims. Jon, good to commit if you ask me.

Thanks again Ray,

Richard.
Comment 15 William Jon McCann 2006-04-04 14:39:57 UTC
Thanks Ray.  I've committed this.  I'll open a new bug for xevie support.