[glade/glade-3-38] GladeGtkContainer: improve add-verify



commit 7f9a36c1d9746db35af0c4ee04bc1668c9edbb4e
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Wed Sep 16 19:30:53 2020 -0300

    GladeGtkContainer: improve add-verify
    
    Special case GtkBin since Windows can hace a placeholder in the titlebar.

 plugins/gtk+/glade-gtk-container.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/plugins/gtk+/glade-gtk-container.c b/plugins/gtk+/glade-gtk-container.c
index fc36b3a2..b11d5059 100644
--- a/plugins/gtk+/glade-gtk-container.c
+++ b/plugins/gtk+/glade-gtk-container.c
@@ -50,6 +50,7 @@ glade_gtk_container_add_verify (GladeWidgetAdaptor *adaptor,
                                 gboolean            user_feedback)
 {
   GladeWidget *gwidget = glade_widget_get_from_gobject (container);
+  GtkWidget *bin_child;
 
   if (GTK_IS_WINDOW (child))
     {
@@ -82,7 +83,11 @@ glade_gtk_container_add_verify (GladeWidgetAdaptor *adaptor,
       return FALSE;
     }
   else if (GLADE_WIDGET_ADAPTOR_USE_PLACEHOLDERS (adaptor) &&
-           glade_util_count_placeholders (gwidget) == 0)
+           /* Special case GtkBin since Windows can hace a placeholder in the titlebar */
+           ((GTK_IS_BIN (container) &&
+             (bin_child = gtk_bin_get_child (GTK_BIN (container))) &&
+              !GLADE_IS_PLACEHOLDER(bin_child)) ||
+            glade_util_count_placeholders (gwidget) == 0))
     {
       if (user_feedback)
         glade_util_ui_message (glade_app_get_window (),


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