[Galago-commits] r2545 - in trunk/notification-daemon: . src
themes/standard
galago-commits at freedesktop.org
galago-commits at freedesktop.org
Sat Feb 4 13:08:27 PST 2006
Author: chipx86
Date: 2006-02-04 13:08:25 -0800 (Sat, 04 Feb 2006)
New Revision: 2545
Modified:
trunk/notification-daemon/ChangeLog
trunk/notification-daemon/src/daemon.c
trunk/notification-daemon/src/engines.c
trunk/notification-daemon/src/engines.h
trunk/notification-daemon/themes/standard/theme.c
Log:
- Make the timer ticks passed to the theme engine more precise.
Modified: trunk/notification-daemon/ChangeLog
===================================================================
--- trunk/notification-daemon/ChangeLog 2006-02-04 20:44:51 UTC (rev 2544)
+++ trunk/notification-daemon/ChangeLog 2006-02-04 21:08:25 UTC (rev 2545)
@@ -1,3 +1,11 @@
+Sat Feb 04 13:08:02 PST 2006 Christian Hammond <chipx86 at chipx86.com>
+
+ * src/daemon.c:
+ * src/engines.c:
+ * src/engines.h:
+ * themes/standard/theme.c:
+ - Make the timer ticks passed to the theme engine more precise.
+
Sat Feb 04 12:44:32 PST 2006 Christian Hammond <chipx86 at chipx86.com>
* themes/standard/theme.c:
Modified: trunk/notification-daemon/src/daemon.c
===================================================================
--- trunk/notification-daemon/src/daemon.c 2006-02-04 20:44:51 UTC (rev 2544)
+++ trunk/notification-daemon/src/daemon.c 2006-02-04 21:08:25 UTC (rev 2545)
@@ -262,6 +262,7 @@
{
NotifyTimeout *nt = (NotifyTimeout *)value;
gboolean *phas_more_timeouts = (gboolean *)data;
+ glong remaining;
GTimeVal now;
if (!nt->has_timeout)
@@ -269,12 +270,13 @@
g_get_current_time(&now);
- theme_notification_tick(nt->nw,
- (nt->expiration.tv_sec - now.tv_sec) * 1000);
+ remaining = ((nt->expiration.tv_sec * 1000) +
+ (nt->expiration.tv_usec / 1000)) -
+ ((now.tv_sec * 1000) + (now.tv_usec / 1000));
- if (now.tv_sec > nt->expiration.tv_sec ||
- (now.tv_sec == nt->expiration.tv_sec &&
- now.tv_usec >= nt->expiration.tv_usec))
+ theme_notification_tick(nt->nw, remaining);
+
+ if (remaining <= 0)
{
_emit_closed_signal(G_OBJECT(nt->nw));
return TRUE;
Modified: trunk/notification-daemon/src/engines.c
===================================================================
--- trunk/notification-daemon/src/engines.c 2006-02-04 20:44:51 UTC (rev 2544)
+++ trunk/notification-daemon/src/engines.c 2006-02-04 21:08:25 UTC (rev 2545)
@@ -22,8 +22,8 @@
void (*add_notification_action)(GtkWindow *nw, const char *label,
const char *key, GCallback cb);
void (*move_notification)(GtkWindow *nw, int x, int y);
- void (*set_notification_timeout)(GtkWindow *nw, guint timeout);
- void (*notification_tick)(GtkWindow *nw, guint timeout);
+ void (*set_notification_timeout)(GtkWindow *nw, glong timeout);
+ void (*notification_tick)(GtkWindow *nw, glong timeout);
} ThemeEngine;
@@ -200,7 +200,7 @@
}
void
-theme_set_notification_timeout(GtkWindow *nw, guint timeout)
+theme_set_notification_timeout(GtkWindow *nw, glong timeout)
{
ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
@@ -209,7 +209,7 @@
}
void
-theme_notification_tick(GtkWindow *nw, guint remaining)
+theme_notification_tick(GtkWindow *nw, glong remaining)
{
ThemeEngine *engine = g_object_get_data(G_OBJECT(nw), "_theme_engine");
Modified: trunk/notification-daemon/src/engines.h
===================================================================
--- trunk/notification-daemon/src/engines.h 2006-02-04 20:44:51 UTC (rev 2544)
+++ trunk/notification-daemon/src/engines.h 2006-02-04 21:08:25 UTC (rev 2545)
@@ -10,8 +10,8 @@
void theme_show_notification(GtkWindow *nw);
void theme_hide_notification(GtkWindow *nw);
void theme_set_notification_hints(GtkWindow *nw, GHashTable *hints);
-void theme_set_notification_timeout(GtkWindow *nw, guint timeout);
-void theme_notification_tick(GtkWindow *nw, guint remaining);
+void theme_set_notification_timeout(GtkWindow *nw, glong timeout);
+void theme_notification_tick(GtkWindow *nw, glong remaining);
void theme_set_notification_text(GtkWindow *nw, const char *summary,
const char *body);
void theme_set_notification_icon(GtkWindow *nw, GdkPixbuf *pixbuf);
Modified: trunk/notification-daemon/themes/standard/theme.c
===================================================================
--- trunk/notification-daemon/themes/standard/theme.c 2006-02-04 20:44:51 UTC (rev 2544)
+++ trunk/notification-daemon/themes/standard/theme.c 2006-02-04 21:08:25 UTC (rev 2545)
@@ -39,8 +39,8 @@
GdkRegion *window_region;
guchar urgency;
- guint timeout;
- guint remaining;
+ glong timeout;
+ glong remaining;
UrlClickedCb url_clicked;
@@ -332,7 +332,7 @@
}
void
-set_notification_timeout(GtkWindow *nw, guint timeout)
+set_notification_timeout(GtkWindow *nw, glong timeout)
{
WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
g_assert(windata != NULL);
@@ -341,7 +341,7 @@
}
void
-notification_tick(GtkWindow *nw, guint remaining)
+notification_tick(GtkWindow *nw, glong remaining)
{
WindowData *windata = g_object_get_data(G_OBJECT(nw), "windata");
windata->remaining = remaining;
More information about the galago-commits
mailing list