[Xfce4-commits] [xfce/xfce4-settings] 01/02: Fix GTimeVal deprecation (Bug #16645)
noreply at xfce.org
noreply at xfce.org
Mon Apr 6 22:54:08 CEST 2020
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfce4-settings.
commit e10bdf6d803d1ed7abd54fa080aabace0d2f4908
Author: Andre Miranda <andreldm at xfce.org>
Date: Mon Apr 6 22:46:12 2020 +0200
Fix GTimeVal deprecation (Bug #16645)
---
xfce4-settings-editor/xfce-settings-editor-box.c | 16 ++++++++--------
xfsettingsd/workspaces.c | 11 +++--------
2 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/xfce4-settings-editor/xfce-settings-editor-box.c b/xfce4-settings-editor/xfce-settings-editor-box.c
index b334c2d..3942095 100644
--- a/xfce4-settings-editor/xfce-settings-editor-box.c
+++ b/xfce4-settings-editor/xfce-settings-editor-box.c
@@ -859,7 +859,7 @@ xfce_settings_editor_box_channel_monitor_changed (XfconfChannel *channel,
GtkWidget *window)
{
GtkTextBuffer *buffer;
- GTimeVal timeval;
+ gint64 timeval;
gchar *str;
GValue str_value = { 0, };
GtkTextIter iter;
@@ -867,7 +867,7 @@ xfce_settings_editor_box_channel_monitor_changed (XfconfChannel *channel,
buffer = g_object_get_data (G_OBJECT (window), "buffer");
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
- g_get_current_time (&timeval);
+ timeval = g_get_real_time ();
if (value != NULL && G_IS_VALUE (value))
{
@@ -875,14 +875,14 @@ xfce_settings_editor_box_channel_monitor_changed (XfconfChannel *channel,
if (g_value_transform (value, &str_value))
{
str = g_strdup_printf ("%ld: %s (%s: %s)\n",
- timeval.tv_sec, property,
+ timeval / G_USEC_PER_SEC, property,
G_VALUE_TYPE_NAME (value),
g_value_get_string (&str_value));
}
else
{
str = g_strdup_printf ("%ld: %s (%s)\n",
- timeval.tv_sec, property,
+ timeval / G_USEC_PER_SEC, property,
G_VALUE_TYPE_NAME (value));
}
g_value_unset (&str_value);
@@ -890,7 +890,7 @@ xfce_settings_editor_box_channel_monitor_changed (XfconfChannel *channel,
else
{
/* I18N: if a property is removed from the channel */
- str = g_strdup_printf ("%ld: %s (%s)\n", timeval.tv_sec,
+ str = g_strdup_printf ("%ld: %s (%s)\n", timeval / G_USEC_PER_SEC,
property, _("reset"));
}
@@ -940,7 +940,7 @@ xfce_settings_editor_box_channel_monitor (XfceSettingsEditorBox *self)
GtkWidget *textview;
GtkWidget *content_area;
GtkTextBuffer *buffer;
- GTimeVal timeval;
+ gint64 timeval;
gchar *str;
GtkTextIter iter;
@@ -986,9 +986,9 @@ xfce_settings_editor_box_channel_monitor (XfceSettingsEditorBox *self)
g_signal_connect (G_OBJECT (self->props_channel), "property-changed",
G_CALLBACK (xfce_settings_editor_box_channel_monitor_changed), window);
- g_get_current_time (&timeval);
+ timeval = g_get_real_time ();
gtk_text_buffer_get_start_iter (buffer, &iter);
- str = g_strdup_printf ("%ld: ", timeval.tv_sec);
+ str = g_strdup_printf ("%ld: ", timeval / G_USEC_PER_SEC);
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, str, -1, "monospace", NULL);
g_free (str);
diff --git a/xfsettingsd/workspaces.c b/xfsettingsd/workspaces.c
index 8bd3dbf..4d274d1 100644
--- a/xfsettingsd/workspaces.c
+++ b/xfsettingsd/workspaces.c
@@ -64,7 +64,7 @@ struct _XfceWorkspacesHelper
XfconfChannel *channel;
- GTimeVal timestamp;
+ gint64 timestamp;
#ifdef GDK_WINDOWING_X11
guint wait_for_wm_timeout_id;
@@ -159,7 +159,6 @@ xfce_workspaces_helper_filter_func (GdkXEvent *gdkxevent,
#ifdef GDK_WINDOWING_X11
XfceWorkspacesHelper *helper = XFCE_WORKSPACES_HELPER (user_data);
XEvent *xevent = gdkxevent;
- GTimeVal timestamp;
if (xevent->type == PropertyNotify)
{
@@ -173,10 +172,7 @@ xfce_workspaces_helper_filter_func (GdkXEvent *gdkxevent,
else if (xevent->xproperty.atom == atom_net_desktop_names)
{
/* don't respond to our own name changes (1 sec) */
- g_get_current_time (×tamp);
- if (timestamp.tv_sec > helper->timestamp.tv_sec
- || (timestamp.tv_sec == helper->timestamp.tv_sec
- && timestamp.tv_usec > helper->timestamp.tv_usec))
+ if (g_get_real_time () > helper->timestamp)
{
/* someone changed (possibly another application that does
* not update xfconf) the name of a desktop, store the
@@ -342,8 +338,7 @@ xfce_workspaces_helper_set_names_real (XfceWorkspacesHelper *helper)
}
/* update stamp so new names is not handled for the next second */
- g_get_current_time (&helper->timestamp);
- g_time_val_add (&helper->timestamp, G_USEC_PER_SEC);
+ helper->timestamp = g_get_real_time () + G_USEC_PER_SEC;
gdk_x11_display_error_trap_push (gdk_display_get_default ());
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list