[notification-daemon] Update the dock for changes



commit ef3db4e1b39921bd4ccdd2bed8d735f8accd59bd
Author: William Jon McCann <jmccann redhat com>
Date:   Fri Oct 8 20:25:17 2010 -0400

    Update the dock for changes

 src/nd-queue.c |   35 +++++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 14 deletions(-)
---
diff --git a/src/nd-queue.c b/src/nd-queue.c
index b40e844..57dfda3 100644
--- a/src/nd-queue.c
+++ b/src/nd-queue.c
@@ -1016,20 +1016,23 @@ update_dock (NdQueue *queue)
                 gtk_box_pack_start (GTK_BOX (child), sep, FALSE, FALSE, 0);
         }
         gtk_widget_show (child);
-        gtk_widget_get_preferred_height (child,
-                                         &min_height,
-                                         &height);
-
-        gtk_status_icon_get_geometry (GTK_STATUS_ICON (queue->priv->status_icon),
-                                      &screen,
-                                      &area,
-                                      NULL);
-        monitor_num = gdk_screen_get_monitor_at_point (screen, area.x, area.y);
-        gdk_screen_get_monitor_geometry (screen, monitor_num, &area);
-        height = MIN (height, (area.height / 2));
-        gtk_widget_set_size_request (queue->priv->dock_scrolled_window,
-                                     WIDTH,
-                                     height);
+
+        if (queue->priv->status_icon != NULL
+            && gtk_status_icon_get_visible (GTK_STATUS_ICON (queue->priv->status_icon))) {
+                gtk_widget_get_preferred_height (child,
+                                                 &min_height,
+                                                 &height);
+                gtk_status_icon_get_geometry (GTK_STATUS_ICON (queue->priv->status_icon),
+                                              &screen,
+                                              &area,
+                                              NULL);
+                monitor_num = gdk_screen_get_monitor_at_point (screen, area.x, area.y);
+                gdk_screen_get_monitor_geometry (screen, monitor_num, &area);
+                height = MIN (height, (area.height / 2));
+                gtk_widget_set_size_request (queue->priv->dock_scrolled_window,
+                                             WIDTH,
+                                             height);
+        }
 
         g_list_free (list);
 }
@@ -1159,6 +1162,10 @@ on_status_icon_visible_notify (GtkStatusIcon *icon,
 static gboolean
 update_idle (NdQueue *queue)
 {
+        if (gtk_widget_get_visible (queue->priv->dock)) {
+                update_dock (queue);
+        }
+
         /* Show the status icon when their are stored notifications */
         if (g_hash_table_size (queue->priv->notifications) > 0) {
                 if (queue->priv->status_icon == NULL) {



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