Commit 6972de50 authored by Jim Krehl's avatar Jim Krehl

fix time overflows

svn path=/branches/SLED10-SP1/; revision=262
parent fb509e32
......@@ -194,14 +194,14 @@ libslab_gnome_desktop_item_open_help (GnomeDesktopItem *item)
return retval;
}
guint32
guint64
libslab_get_current_time_millis ()
{
GTimeVal t_curr;
g_get_current_time (& t_curr);
return 1000L * t_curr.tv_sec + t_curr.tv_usec / 1000L;
return 1000 * ((guint64) t_curr.tv_sec) + ((guint64) t_curr.tv_usec) / 1000;
}
gint
......
......@@ -13,7 +13,7 @@ GnomeDesktopItem *libslab_gnome_desktop_item_new_from_unknown_id (const gchar *i
gboolean libslab_gnome_desktop_item_launch_default (GnomeDesktopItem *item);
gchar *libslab_gnome_desktop_item_get_docpath (GnomeDesktopItem *item);
gboolean libslab_gnome_desktop_item_open_help (GnomeDesktopItem *item);
guint32 libslab_get_current_time_millis (void);
guint64 libslab_get_current_time_millis (void);
gint libslab_strcmp (const gchar *a, const gchar *b);
gint libslab_strlen (const gchar *a);
gpointer libslab_get_gconf_value (const gchar *key);
......
......@@ -1605,8 +1605,7 @@ panel_button_clicked_cb (GtkButton *button, gpointer user_data)
GtkToggleButton *toggle = GTK_TOGGLE_BUTTON (button);
DoubleClickDetector *detector;
GTimeVal t_curr;
guint32 t_curr_ms;
guint64 t_curr_ms;
gboolean visible;
......@@ -1614,8 +1613,7 @@ panel_button_clicked_cb (GtkButton *button, gpointer user_data)
detector = DOUBLE_CLICK_DETECTOR (
g_object_get_data (G_OBJECT (toggle), "double-click-detector"));
g_get_current_time (& t_curr);
t_curr_ms = 1000 * t_curr.tv_sec + t_curr.tv_usec / 1000;
t_curr_ms = libslab_get_current_time_millis ();
visible = GTK_WIDGET_VISIBLE (priv->slab_window);
......@@ -2047,8 +2045,7 @@ more_buttons_clicked_cb (GtkButton *button, gpointer user_data)
MainMenuUIPrivate *priv = PRIVATE (this);
DoubleClickDetector *detector;
GTimeVal current_time;
guint32 current_time_millis;
guint64 t_curr_ms;
GnomeDesktopItem *ditem;
gchar *ditem_id;
......@@ -2062,11 +2059,9 @@ more_buttons_clicked_cb (GtkButton *button, gpointer user_data)
detector = DOUBLE_CLICK_DETECTOR (
g_object_get_data (G_OBJECT (button), "double-click-detector"));
g_get_current_time (& current_time);
t_curr_ms = libslab_get_current_time_millis ();
current_time_millis = 1000 * current_time.tv_sec + current_time.tv_usec / 1000;
if (! double_click_detector_is_double_click (detector, current_time_millis, TRUE)) {
if (! double_click_detector_is_double_click (detector, t_curr_ms, TRUE)) {
if (GTK_WIDGET (button) == priv->more_buttons [APPS_PAGE])
ditem_id = libslab_get_gconf_value (APP_BROWSER_GCONF_KEY);
else if (GTK_WIDGET (button) == priv->more_buttons [DOCS_PAGE]) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment