[yelp] [yelp-window] Fix some critical warnings



commit 9696dc6d909bdefc2d9f7406ac58cdbf8715a9ae
Author: Shaun McCance <shaunm gnome org>
Date:   Tue Jan 4 17:33:59 2011 -0500

    [yelp-window] Fix some critical warnings

 src/yelp-window.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/src/yelp-window.c b/src/yelp-window.c
index 4aab8a2..7605d11 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -1492,9 +1492,10 @@ view_uri_selected (YelpView     *view,
         return;
 
     gdkwin = gtk_widget_get_window (GTK_WIDGET (window));
-    gdk_window_set_cursor (gdkwin,
-                           gdk_cursor_new_for_display (gdk_window_get_display (gdkwin),
-                                                       GDK_WATCH));
+    if (gdkwin != NULL)
+        gdk_window_set_cursor (gdkwin,
+                               gdk_cursor_new_for_display (gdk_window_get_display (gdkwin),
+                                                           GDK_WATCH));
 
     doc_uri = yelp_uri_get_document_uri (uri);
     if (priv->doc_uri == NULL || !g_str_equal (priv->doc_uri, doc_uri)) {
@@ -1552,11 +1553,13 @@ hidden_entry_hide (YelpWindow  *window)
 {
     YelpWindowPrivate *priv = GET_PRIV (window);
 
-    gtk_container_remove (GTK_CONTAINER (priv->hbox),
-                          priv->align_hidden);
-    gtk_box_pack_start (GTK_BOX (priv->hbox),
-                        priv->align_location,
-                        TRUE, TRUE, 0);
+    if (gtk_widget_get_parent (priv->align_hidden) != NULL) {
+        gtk_container_remove (GTK_CONTAINER (priv->hbox),
+                              priv->align_hidden);
+        gtk_box_pack_start (GTK_BOX (priv->hbox),
+                            priv->align_location,
+                            TRUE, TRUE, 0);
+    }
 }
 
 static gboolean



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