[gtk/wip/baedert/for-master] window: Keep titlebar after main child



commit 547842e7f06a096a3c998b136889976219675d39
Author: Timm Bäder <mail baedert org>
Date:   Sat Aug 1 09:30:48 2020 +0200

    window: Keep titlebar after main child
    
    Fixes #2949

 gtk/gtkwindow.c                           | 10 +++++-----
 testsuite/css/style/bloomfilter-not.nodes |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index c9da4da3d2..984e766be0 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -132,8 +132,8 @@
  *
  * |[<!-- language="plain" -->
  * window.background
- * ├── <titlebar child>.titlebar [.default-decoration]
- * ╰── <child>
+ * ├── <child>
+ * ╰── <titlebar child>.titlebar [.default-decoration]
  * ]|
  *
  * GtkWindow has a main CSS node with name window and style class .background.
@@ -2824,7 +2824,7 @@ gtk_window_set_titlebar (GtkWindow *window,
 
   gtk_window_enable_csd (window);
   priv->title_box = titlebar;
-  gtk_widget_insert_after (priv->title_box, widget, NULL);
+  gtk_widget_insert_before (priv->title_box, widget, NULL);
 
   gtk_widget_add_css_class (titlebar, GTK_STYLE_CLASS_TITLEBAR);
 
@@ -4308,7 +4308,7 @@ gtk_window_realize (GtkWidget *widget)
                 gtk_widget_add_css_class (priv->titlebar, GTK_STYLE_CLASS_TITLEBAR);
                 gtk_widget_add_css_class (priv->titlebar, "default-decoration");
 
-                gtk_widget_insert_after (priv->titlebar, widget, NULL);
+                gtk_widget_insert_before (priv->titlebar, widget, NULL);
                 priv->title_box = priv->titlebar;
               }
 
@@ -7084,7 +7084,7 @@ gtk_window_set_child (GtkWindow *window,
   if (child)
     {
       priv->child = child;
-      gtk_widget_set_parent (child, GTK_WIDGET (window));
+      gtk_widget_insert_before (child, GTK_WIDGET (window), priv->title_box);
     }
 
   g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_CHILD]);
diff --git a/testsuite/css/style/bloomfilter-not.nodes b/testsuite/css/style/bloomfilter-not.nodes
index 05eed05b8c..97701dc4cb 100644
--- a/testsuite/css/style/bloomfilter-not.nodes
+++ b/testsuite/css/style/bloomfilter-not.nodes
@@ -1,4 +1,8 @@
 window.background.csd:dir(ltr)
+  stack:dir(ltr)
+    box.horizontal:dir(ltr)
+    box.horizontal:dir(ltr)
+    box.horizontal:dir(ltr)
   headerbar.titlebar:dir(ltr)
     windowhandle:dir(ltr)
       box:dir(ltr)
@@ -15,7 +19,3 @@ window.background.csd:dir(ltr)
           button.text-button.toggle:dir(ltr)
             label:dir(ltr)
         box.end.horizontal:dir(ltr)
-  stack:dir(ltr)
-    box.horizontal:dir(ltr)
-    box.horizontal:dir(ltr)
-    box.horizontal:dir(ltr)


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