[gnome-panel] [notification_area] Fix some bugs from the GSEALing



commit e08b9754227464285401006bf69fa6c382df2a9f
Author: Dan Winship <danw gnome org>
Date:   Thu Aug 19 10:08:41 2010 -0400

    [notification_area] Fix some bugs from the GSEALing
    
    na-tray-child.c had C99 mixed code and declarations.
    na-tray-manager.c was calling methods on an object before checking that
    it was non-NULL
    
    Noticed while syncing the code to gnome-shell, bug 627306
    
    https://bugzilla.gnome.org/show_bug.cgi?id=627368

 applets/notification_area/na-tray-child.c   |    9 +++++----
 applets/notification_area/na-tray-manager.c |   10 ++++++----
 2 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/applets/notification_area/na-tray-child.c b/applets/notification_area/na-tray-child.c
index ccc2368..79bca26 100644
--- a/applets/notification_area/na-tray-child.c
+++ b/applets/notification_area/na-tray-child.c
@@ -132,13 +132,14 @@ na_tray_child_size_allocate (GtkWidget      *widget,
 {
   NaTrayChild *child = NA_TRAY_CHILD (widget);
   GtkAllocation widget_allocation;
+  gboolean moved, resized;
 
   gtk_widget_get_allocation (widget, &widget_allocation);
 
-  gboolean moved = allocation->x != widget_allocation.x ||
-                   allocation->y != widget_allocation.y;
-  gboolean resized = allocation->width != widget_allocation.width ||
-                     allocation->height != widget_allocation.height;
+  moved = (allocation->x != widget_allocation.x ||
+	   allocation->y != widget_allocation.y);
+  resized = (allocation->width != widget_allocation.width ||
+	     allocation->height != widget_allocation.height);
 
   /* When we are allocating the widget while mapped we need special handling
    * for both real and fake transparency.
diff --git a/applets/notification_area/na-tray-manager.c b/applets/notification_area/na-tray-manager.c
index 4173cbd..8a1adf1 100644
--- a/applets/notification_area/na-tray-manager.c
+++ b/applets/notification_area/na-tray-manager.c
@@ -585,9 +585,10 @@ na_tray_manager_set_orientation_property (NaTrayManager *manager)
   Atom        orientation_atom;
   gulong      data[1];
 
+  if (!manager->invisible)
+    return;
   window = gtk_widget_get_window (manager->invisible);
-
-  if (!manager->invisible || !window)
+  if (!window)
     return;
 
   display = gtk_widget_get_display (manager->invisible);
@@ -617,9 +618,10 @@ na_tray_manager_set_visual_property (NaTrayManager *manager)
   Atom        visual_atom;
   gulong      data[1];
 
+  if (!manager->invisible)
+    return;
   window = gtk_widget_get_window (manager->invisible);
-
-  if (!manager->invisible || !window)
+  if (!window)
     return;
 
   /* The visual property is a hint to the tray icons as to what visual they



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