summaryrefslogtreecommitdiff
path: root/src/core/effects.c
diff options
context:
space:
mode:
authorrbuj <robert.buj@gmail.com>2020-02-03 13:39:55 +0100
committerraveit65 <mate@raveit.de>2020-02-21 17:31:50 +0100
commit3b6919c5eafb76f36f240f8c5651698539860853 (patch)
treeba8ada86c24155c94aca9ade30d194eebec7adfc /src/core/effects.c
parent7ffa17976ba5d0549ac2fb8a81c65dd19aac3767 (diff)
downloadmarco-3b6919c5eafb76f36f240f8c5651698539860853.tar.bz2
marco-3b6919c5eafb76f36f240f8c5651698539860853.tar.xz
remove warning: 'GTimeVal' is deprecated
Diffstat (limited to 'src/core/effects.c')
-rw-r--r--src/core/effects.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/core/effects.c b/src/core/effects.c
index 2866246f..f23c60f2 100644
--- a/src/core/effects.c
+++ b/src/core/effects.c
@@ -79,7 +79,7 @@ typedef struct
MetaScreen *screen;
double millisecs_duration;
- GTimeVal start_time;
+ gint64 start_time;
#ifdef HAVE_SHAPE
/** For wireframe window */
@@ -318,7 +318,7 @@ static gboolean
effects_draw_box_animation_timeout (BoxAnimationContext *context)
{
double elapsed;
- GTimeVal current_time;
+ gint64 current_time;
MetaRectangle draw_rect;
double fraction;
@@ -337,12 +337,10 @@ effects_draw_box_animation_timeout (BoxAnimationContext *context)
#endif /* !HAVE_SHAPE */
- g_get_current_time (&current_time);
+ current_time = g_get_real_time ();
/* We use milliseconds for all times */
- elapsed =
- ((((double)current_time.tv_sec - context->start_time.tv_sec) * G_USEC_PER_SEC +
- (current_time.tv_usec - context->start_time.tv_usec))) / 1000.0;
+ elapsed = (current_time - context->start_time) / 1000.0;
if (elapsed < 0)
{
@@ -481,7 +479,7 @@ draw_box_animation (MetaScreen *screen,
/* Do this only after we get the pixbuf from the server,
* so that the animation doesn't get truncated.
*/
- g_get_current_time (&context->start_time);
+ context->start_time = g_get_real_time ();
/* Add the timeout - a short one, could even use an idle,
* but this is maybe more CPU-friendly.