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 692611 - Saving power: Use g_timeout_add_seconds
Saving power: Use g_timeout_add_seconds
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Mouse
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-01-27 03:39 UTC by B.Prathibha
Modified: 2013-04-19 15:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use g_timeout_add_seconds wherever possible. (1.60 KB, patch)
2013-01-27 03:41 UTC, B.Prathibha
needs-work Details | Review

Comment 1 B.Prathibha 2013-01-27 03:41:23 UTC
Created attachment 234504 [details] [review]
Use g_timeout_add_seconds wherever possible.
Comment 2 Bastien Nocera 2013-01-27 13:00:50 UTC
Review of attachment 234504 [details] [review]:

Prefix the commit subject line with "mouse: "

::: panels/mouse/gnome-mouse-test.c
@@ +159,3 @@
 	data.widget = widget;
 	data.timeout_id = &information_label_timeout_id;
+	information_label_timeout_id = g_timeout_add_seconds (2.5,

That's nice. Except that g_timeout_add_seconds() takes an integer, not a float.

@@ +234,3 @@
 			data.widget = widget;
 			data.timeout_id = &button_drawing_area_timeout_id;
+			button_drawing_area_timeout_id = g_timeout_add_seconds (2.5, (GSourceFunc) test_maybe_timeout, &data);

Ditto.
Comment 3 B.Prathibha 2013-01-27 14:25:29 UTC
(In reply to comment #2)
> Review of attachment 234504 [details] [review]:
> 
> Prefix the commit subject line with "mouse: "
> 
> ::: panels/mouse/gnome-mouse-test.c
> @@ +159,3 @@
>      data.widget = widget;
>      data.timeout_id = &information_label_timeout_id;
> +    information_label_timeout_id = g_timeout_add_seconds (2.5,
> 
> That's nice. Except that g_timeout_add_seconds() takes an integer, not a float.

Can it be rounded off to 3 sec.
> 
> @@ +234,3 @@
>              data.widget = widget;
>              data.timeout_id = &button_drawing_area_timeout_id;
> +            button_drawing_area_timeout_id = g_timeout_add_seconds (2.5,
> (GSourceFunc) test_maybe_timeout, &data);
> 
> Ditto.
Comment 4 Bastien Nocera 2013-01-28 10:06:12 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Review of attachment 234504 [details] [review] [details]:
> > 
> > Prefix the commit subject line with "mouse: "
> > 
> > ::: panels/mouse/gnome-mouse-test.c
> > @@ +159,3 @@
> >      data.widget = widget;
> >      data.timeout_id = &information_label_timeout_id;
> > +    information_label_timeout_id = g_timeout_add_seconds (2.5,
> > 
> > That's nice. Except that g_timeout_add_seconds() takes an integer, not a float.
> 
> Can it be rounded off to 3 sec.

No, and same problem for the other 2.5 seconds timeout. Given that they only trigger when you double-click/triple-click in the test area, I don't think that this is high priority, or saving power.
Comment 5 B.Prathibha 2013-01-28 15:38:35 UTC
As per the comment from HavocPennington in the corresponding https://live.gnome.org/GnomeGoals/UseTimeoutAddSeconds, the callback functions used here in all three cases in the attached patch are non-recurring. So using add_seconds here will not be use.
Comment 6 Bastien Nocera 2013-04-19 15:37:10 UTC
I guess there's nothing left to be done here.