[gtk+] Don't pass NULL to gdk_window_set_title



commit d632474b743a50a2d9d24a04a7f2e14f7e3ba0ee
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Sep 16 13:06:13 2013 -0400

    Don't pass NULL to gdk_window_set_title
    
    That is not allowed. This is fallout from a recent change
    that makes GtkWindow listen for title changes in its
    headerbar.

 gtk/gtkwindow.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index fb3c5c9..50ed413 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1792,11 +1792,14 @@ gtk_window_set_title_internal (GtkWindow   *window,
   g_free (priv->title);
   priv->title = new_title;
 
+  if (new_title == NULL)
+    new_title = "";
+
   if (gtk_widget_get_realized (widget))
-    gdk_window_set_title (gtk_widget_get_window (widget), priv->title);
+    gdk_window_set_title (gtk_widget_get_window (widget), new_title);
 
   if (priv->titlebar != NULL && update_titlebar)
-    gtk_header_bar_set_title (GTK_HEADER_BAR (priv->titlebar), priv->title);
+    gtk_header_bar_set_title (GTK_HEADER_BAR (priv->titlebar), new_title);
 
   g_object_notify (G_OBJECT (window), "title");
 }


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