From 308c5bf0a396b749faa7435f0e5adf046a99014f Mon Sep 17 00:00:00 2001 From: Osamu Aoki Date: Wed, 28 Jul 2021 13:36:29 +0900 Subject: 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 --- 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 (), -- cgit v1.2.1