[network-manager-applet/NETWORKMANAGER_APPLET_0_7] applet: fix animation glitches and freezes



commit efa170820623e7c1d6c161bfc8a37db0d074d09e
Author: Dan Williams <dcbw redhat com>
Date:   Wed Sep 30 23:05:20 2009 -0700

    applet: fix animation glitches and freezes
    
    applet_common_device_state_changed() gets called for all devices; but since
    it starts/stops animations, which should only happen for active devices,
    it should only get called for active or activating devices.
    
    Fixes a problem where animation would start, but then the client would
    receive a state update for other devices which would end up stopping
    the animation even though the other device wasn't active or activating.

 src/applet.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index 3e3c3c6..420113e 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -1667,6 +1667,10 @@ applet_common_device_state_changed (NMDevice *device,
 	NMConnection *connection;
 	NMActiveConnection *active = NULL;
 
+	connection = applet_find_active_connection_for_device (device, applet, &active);
+	if (!connection)
+		return;
+
 	switch (new_state) {
 	case NM_DEVICE_STATE_PREPARE:
 	case NM_DEVICE_STATE_CONFIG:
@@ -1678,8 +1682,7 @@ applet_common_device_state_changed (NMDevice *device,
 		/* If the device activation was successful, update the corresponding
 		 * connection object with a current timestamp.
 		 */
-		connection = applet_find_active_connection_for_device (device, applet, &active);
-		if (connection && active)
+		if (active)
 			update_connection_timestamp (active, connection, applet);
 		/* Fall through */
 	default:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]