[gtk/popup-shadow-width] headerbar: Don't use gtk_widget_unparent() with GtkBox
- From: Matthias Clasen <matthiasc src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gtk/popup-shadow-width] headerbar: Don't use gtk_widget_unparent() with GtkBox
 
- Date: Sat, 13 Feb 2021 20:47:15 +0000 (UTC)
 
commit 122676c5e8fbe83ecc8d0c941676b95c0630177d
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Feb 8 17:52:10 2021 +0500
    headerbar: Don't use gtk_widget_unparent() with GtkBox
    
    gtk_widget_unparent() is for widget implementations, it's not supposed to
    be used from outside.
 gtk/gtkheaderbar.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index 30423b9d48..6f90f38f6b 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -743,8 +743,17 @@ gtk_header_bar_set_show_title_buttons (GtkHeaderBar *bar,
     create_window_controls (bar);
   else
     {
-      g_clear_pointer (&bar->start_window_controls, gtk_widget_unparent);
-      g_clear_pointer (&bar->end_window_controls, gtk_widget_unparent);
+      if (bar->start_window_controls)
+        {
+          gtk_box_remove (GTK_BOX (bar->start_box), bar->start_window_controls);
+          bar->start_window_controls = NULL;
+        }
+
+      if (ar->end_window_controls)
+        {
+          gtk_box_remove (GTK_BOX (bar->end_box), bar->end_window_controls);
+          bar->end_window_controls = NULL;
+        }
     }
 
   g_object_notify_by_pspec (G_OBJECT (bar), header_bar_props[PROP_SHOW_TITLE_BUTTONS]);
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]