[glade] Drop overzealous check using only the first child



commit 308c5bf0a396b749faa7435f0e5adf046a99014f
Author: Osamu Aoki <osamu debian org>
Date:   Wed Jul 28 13:36:29 2021 +0900

    Drop overzealous check using only the first child
    
    This fixes issue #499 and #509
    
    * Can't add GtkHeaderBar to window with existing widgets / containers
    * Cannot add GtkBox or other widgets inside a GtkPopoverMenu
    
    Please note:
    
    bin_child = gtk_bin_get_child (GTK_BIN (container))) was getting the
    first child only.  Checking if the first child is placeholder causes
    false positives.
    
    glade_util_count_placeholders (gwidget) recursively checks placeholder.
    
    Signed-off-by: Osamu Aoki <osamu debian org>

 plugins/gtk+/glade-gtk-container.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk-container.c b/plugins/gtk+/glade-gtk-container.c
index eb6552a3..18a22826 100644
--- a/plugins/gtk+/glade-gtk-container.c
+++ b/plugins/gtk+/glade-gtk-container.c
@@ -87,11 +87,7 @@ glade_gtk_container_add_verify (GladeWidgetAdaptor *adaptor,
     /* GtkBox and GtkGrid size is adjusted automaticaly in GladeCommand */
     return TRUE;
   else if (GLADE_WIDGET_ADAPTOR_USE_PLACEHOLDERS (adaptor) &&
-           /* 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))
+           (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]