[gtk+] window: Allow unsetting custom titlebar



commit 8db2ba425aaff107faaa4c7468be63f8ef2fa8e9
Author: William Jon McCann <william jon mccann gmail com>
Date:   Fri Jan 10 15:25:27 2014 -0500

    window: Allow unsetting custom titlebar
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720059

 gtk/gtkwindow.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index f34f943..1b0ad7b 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -3615,7 +3615,7 @@ on_titlebar_title_notify (GtkHeaderBar *titlebar,
 /**
  * gtk_window_set_titlebar:
  * @window: a #GtkWindow
- * @titlebar: the widget to use as titlebar
+ * @titlebar: (allow-none): the widget to use as titlebar
  *
  * Sets a custom titlebar for @window.
  *
@@ -3639,6 +3639,13 @@ gtk_window_set_titlebar (GtkWindow *window,
 
   unset_titlebar (window);
 
+  if (titlebar == NULL)
+    {
+      priv->custom_title = FALSE;
+      priv->client_decorated = FALSE;
+      return;
+    }
+
   if (gdk_window_supports_csd (window))
     gdk_window_enable_csd (window);
   else


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