From 5db5b5a80bdfd09ffac68ce7a61d648c2d64e6ec Mon Sep 17 00:00:00 2001 From: Christopher Aillon Date: Wed, 2 Nov 2005 06:40:10 +0000 Subject: [PATCH] 2005-11-02 Christopher Aillon * gnome/applet/applet.c: * gnome/applet/applet.h: Partial backout of Dan's timeout animation patch. Timeout IDs cannot legally be 0, so revert the code in place to handle a timeout ID of 0 to denote the timeout isn't running. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1089 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 8 ++++++++ gnome/applet/applet.c | 18 +++++++----------- gnome/applet/applet.h | 1 - 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 94b1718d79..d9de465ffa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-11-02 Christopher Aillon + + * gnome/applet/applet.c: + * gnome/applet/applet.h: + Partial backout of Dan's timeout animation patch. + Timeout IDs cannot legally be 0, so revert the code in place to handle + a timeout ID of 0 to denote the timeout isn't running. + 2005-11-02 Christopher Aillon * src/NetworkManagerPolicy.c: diff --git a/gnome/applet/applet.c b/gnome/applet/applet.c index 933cdac092..a67c74fc29 100644 --- a/gnome/applet/applet.c +++ b/gnome/applet/applet.c @@ -126,7 +126,7 @@ NetworkDevice * nmwa_get_first_active_device (GSList *dev_list) static void nmwa_init (NMWirelessApplet *applet) { - applet->animation_active = FALSE; + applet->animation_id = 0; applet->animation_step = 0; glade_gnome_init (); @@ -1016,7 +1016,7 @@ static gboolean animation_timeout (NMWirelessApplet *applet) if (!applet->nm_running) { applet->animation_step = 0; - applet->animation_active = FALSE; + applet->animation_id = 0; return FALSE; } @@ -1024,7 +1024,7 @@ static gboolean animation_timeout (NMWirelessApplet *applet) if (!act_dev) { applet->animation_step = 0; - applet->animation_active = FALSE; + applet->animation_id = 0; return FALSE; } @@ -1054,7 +1054,6 @@ static gboolean animation_timeout (NMWirelessApplet *applet) else { applet->animation_step = 0; - applet->animation_active = FALSE; nmwa_update_state (applet); return FALSE; } @@ -1166,17 +1165,14 @@ done: g_free (tip); applet->animation_step = 0; - if (need_animation && !applet->animation_active) - { + if (need_animation && applet->animation_id == 0) applet->animation_id = g_timeout_add (100, (GSourceFunc) animation_timeout, applet); - applet->animation_active = TRUE; - } else if (!need_animation) { - if (applet->animation_active) + if (applet->animation_id) { g_source_remove (applet->animation_id); - applet->animation_active = FALSE; + applet->animation_id = 0; } if (pixbuf) @@ -1201,7 +1197,7 @@ done: */ static int nmwa_redraw_timeout (NMWirelessApplet *applet) { - if (!applet->animation_active) + if (!applet->animation_id) nmwa_update_state (applet); return TRUE; diff --git a/gnome/applet/applet.h b/gnome/applet/applet.h index a52c815411..c397de1fd1 100644 --- a/gnome/applet/applet.h +++ b/gnome/applet/applet.h @@ -108,7 +108,6 @@ typedef struct /* Animation stuff */ int animation_step; - gboolean animation_active; guint animation_id; /* Direct UI elements */