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 656627 - Use g_timeout_real_time_add_full()
Use g_timeout_real_time_add_full()
Status: RESOLVED FIXED
Product: gnome-screensaver
Classification: Deprecated
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-screensaver maintainers
gnome-screensaver maintainers
Depends on: 655129
Blocks:
 
 
Reported: 2011-08-16 08:36 UTC by Colin Walters
Modified: 2011-08-29 15:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use g_timeout_real_time_add_full() (4.02 KB, patch)
2011-08-16 08:36 UTC, Colin Walters
reviewed Details | Review

Description Colin Walters 2011-08-16 08:36:43 UTC
This is more efficient and a better API.

Note this effectively reverts:
  9f98f3a20b5eec6a1fa13e5a4972eadc2d728acf
  da2148e09ee162481a0ffbc106a37e81ff7af790
Comment 1 Colin Walters 2011-08-16 08:36:49 UTC
Created attachment 193915 [details] [review]
Use g_timeout_real_time_add_full()
Comment 2 Ray Strode [halfline] 2011-08-16 14:27:09 UTC
Review of attachment 193915 [details] [review]:

> Date: Tue, 16 Aug 2011 04:34:35 -0400
Wow, crazy early.  Thanks for all the work on this.

::: src/gs-window-x11.c
@@ +2236,1 @@
+        microseconds = g_date_time_difference (expiry, now);

Isn't this always 60 000 000 ?  Why go through the gymnastics for a constant value?

Also what happens if the clock skews between here and the g_timeout_real_time_add_full call?

Maybe this should be a recurring timeout instead?

@@ +2245,3 @@
+                                                                      (GSourceFunc)update_clock_reset_timer,
+                                                                      window,
+                                                                      NULL);

Since this is new api, should bump the minimum glib version required in configure.

@@ -2445,3 @@
-        window->priv->upower_client = up_client_new ();
-        g_signal_connect (window->priv->upower_client, "notify-resume",
-                          G_CALLBACK (on_upower_resume), window);

Now that this is gone, the buildreq should get dropped from configure
Comment 3 Colin Walters 2011-08-17 07:37:34 UTC
Comment on attachment 193915 [details] [review]
Use g_timeout_real_time_add_full()

(In reply to comment #2)
> Review of attachment 193915 [details] [review]:
> 
> > Date: Tue, 16 Aug 2011 04:34:35 -0400
> Wow, crazy early.  Thanks for all the work on this.

I'm actually on vacation in Croatia now =)  Just having fun with this while my girlfriend works some in the morning.

> ::: src/gs-window-x11.c
> @@ +2236,1 @@
> +        microseconds = g_date_time_difference (expiry, now);
> 
> Isn't this always 60 000 000 ?  Why go through the gymnastics for a constant
> value?

Yes, thinko.  I have a fixed patch locally for this (and other comments) but I'll just redo it when bug 655129 is updated.