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 582703 - Please consider using g_timeout_add_seconds to reduce wakeups
Please consider using g_timeout_add_seconds to reduce wakeups
Product: gnome-settings-daemon
Classification: Core
Component: plugins
Other Linux
: Normal trivial
: ---
Assigned To: gnome-settings-daemon-maint
Depends on:
Reported: 2009-05-15 03:25 UTC by Javier Jardón (IRC: jjardon)
Modified: 2010-10-13 18:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28

Use g_timeout_add_seconds instead g_timeout_add (1.60 KB, patch)
2009-05-15 03:27 UTC, Javier Jardón (IRC: jjardon)
none Details | Review

Description Javier Jardón (IRC: jjardon) 2009-05-15 03:25:54 UTC
From, (and of course according to the gtk docs) using g_timeout_add_seconds is preferred over g_timeout_add if a timeout in seconds is desired.
Comment 1 Javier Jardón (IRC: jjardon) 2009-05-15 03:27:12 UTC
Created attachment 134677 [details] [review]
Use g_timeout_add_seconds instead g_timeout_add
Comment 2 Paolo Borelli 2009-05-15 07:13:23 UTC
I admit I have not read the surrounding code, but "show-dialog" sounds definitely like a case where add_seconds shpuld not be used:
1) it's UI related so I think it is nicer if the dialog pops up 5 seconds later consistently, not one time 4 seconds later the next 6 seconds later
2) these dialogs are proably shown when changing settings, which I'd say happens something line once a year, so you are not really saving any power :)
Comment 3 Baptiste Mille-Mathias 2010-08-20 20:16:38 UTC
Hi paolo,

so should the bug be closed as WONTFIX?
Comment 4 Bastien Nocera 2010-10-13 18:08:50 UTC
Changed those 2 instances, which we the only ones that made sense reading the code.

commit 5e85aa9cdf6624effea5a890a2516f11d25a8bf3
Author: Bastien Nocera <>
Date:   Wed Oct 13 19:07:36 2010 +0100

    smartcard: Use g_timeout_add_seconds()
    Instead of g_timeout_add() as 2 seconds is coarse enough for us.

commit 61c8ca9ad8add09830e72d0c10b97f59e80dd0f5
Author: Bastien Nocera <>
Date:   Wed Oct 13 19:06:58 2010 +0100

    daemon: Use g_timeout_add_seconds
    Rather than g_timeout_add() as we're looking for 1/2 minute timeouts