summaryrefslogtreecommitdiff
path: root/savers/floaters.c
diff options
context:
space:
mode:
Diffstat (limited to 'savers/floaters.c')
-rw-r--r--savers/floaters.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/savers/floaters.c b/savers/floaters.c
index d1e7cc9..9e75f7b 100644
--- a/savers/floaters.c
+++ b/savers/floaters.c
@@ -2,6 +2,7 @@
* Copyright (C) 2005 Ray Strode <[email protected]>,
* Matthias Clasen <[email protected]>,
* Søren Sandmann <[email protected]>
+ * Copyright (C) 2012-2021 MATE Developers
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License as
@@ -806,11 +807,11 @@ screen_saver_new (GtkWidget *drawing_area,
g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) cached_source_free);
- g_signal_connect_swapped (G_OBJECT (drawing_area), "size-allocate",
+ g_signal_connect_swapped (drawing_area, "size-allocate",
G_CALLBACK (screen_saver_on_size_allocate),
screen_saver);
- g_signal_connect_swapped (G_OBJECT (drawing_area), "draw",
+ g_signal_connect_swapped (drawing_area, "draw",
G_CALLBACK (screen_saver_on_draw),
screen_saver);
@@ -824,8 +825,8 @@ screen_saver_new (GtkWidget *drawing_area,
screen_saver->floaters = NULL;
screen_saver->max_floater_count = max_floater_count;
- screen_saver->should_show_paths = should_show_paths;
- screen_saver->should_do_rotations = should_do_rotations;
+ screen_saver->should_show_paths = (should_show_paths != FALSE);
+ screen_saver->should_do_rotations = (should_do_rotations != FALSE);
screen_saver_get_initial_state (screen_saver);
@@ -868,15 +869,8 @@ screen_saver_free (ScreenSaver *screen_saver)
static gdouble
screen_saver_get_timestamp (ScreenSaver *screen_saver)
{
- const gdouble microseconds_per_second = (gdouble ) G_USEC_PER_SEC;
- gdouble timestamp;
- GTimeVal now = { 0L, /* zero-filled */ };
-
- g_get_current_time (&now);
- timestamp = ((microseconds_per_second * now.tv_sec) + now.tv_usec) /
- microseconds_per_second;
-
- return timestamp;
+ gint64 now = g_get_real_time ();
+ return (gdouble) now / (gdouble) G_USEC_PER_SEC;
}
static void
@@ -1148,7 +1142,7 @@ main (int argc,
N_("The initial size and position of window"), N_("WIDTHxHEIGHT+X+Y") },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames,
N_("The source image to use"), NULL },
- {NULL}
+ { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
@@ -1162,7 +1156,6 @@ main (int argc,
_("image - floats images around the screen"),
options, GETTEXT_PACKAGE, &error);
-
if (error != NULL)
{
g_printerr (_("%s. See --help for usage information.\n"),
@@ -1181,8 +1174,9 @@ main (int argc,
window = gs_theme_window_new ();
- g_signal_connect (G_OBJECT (window), "delete-event",
- G_CALLBACK (gtk_main_quit), NULL);
+ g_signal_connect (window, "delete-event",
+ G_CALLBACK (gtk_main_quit),
+ NULL);
drawing_area = GTK_WIDGET (gtk_drawing_area_new ());