From 49ae68c2c70254bdc20fdba05f77ef866c178ddd Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Mon, 23 Jul 2018 13:00:11 +0300 Subject: [PATCH 1/3] gtkpopovermenu: Drop call to gtk_widget_show() The stack is already visible. --- gtk/gtkpopovermenu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/gtk/gtkpopovermenu.c b/gtk/gtkpopovermenu.c index bb08b3efed..3ee3639bcd 100644 --- a/gtk/gtkpopovermenu.c +++ b/gtk/gtkpopovermenu.c @@ -139,7 +139,6 @@ gtk_popover_menu_init (GtkPopoverMenu *popover) gtk_stack_set_vhomogeneous (GTK_STACK (stack), FALSE); gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT); gtk_stack_set_interpolate_size (GTK_STACK (stack), TRUE); - gtk_widget_show (stack); gtk_container_add (GTK_CONTAINER (popover), stack); g_signal_connect (stack, "notify::visible-child-name", G_CALLBACK (visible_submenu_changed), popover); From d88268c142e93dfe2fea0350f0d0726e09ddfe07 Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Mon, 23 Jul 2018 13:01:01 +0300 Subject: [PATCH 2/3] gtkpopovermenu: Conditionally chain up in gtk_popover_menu_add() Otherwise the stack gets parented to the wrong widget and the contents are never drawn. --- gtk/gtkpopovermenu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gtk/gtkpopovermenu.c b/gtk/gtkpopovermenu.c index 3ee3639bcd..9f6f5564c5 100644 --- a/gtk/gtkpopovermenu.c +++ b/gtk/gtkpopovermenu.c @@ -171,8 +171,7 @@ gtk_popover_menu_add (GtkContainer *container, if (stack == NULL) { - gtk_widget_set_parent (child, GTK_WIDGET (container)); - _gtk_bin_set_child (GTK_BIN (container), child); + GTK_CONTAINER_CLASS (gtk_popover_menu_parent_class)->add (container, child); } else { From 1fbbaef49e5b76d57b38361b586c6898cff27542 Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Mon, 23 Jul 2018 13:05:57 +0300 Subject: [PATCH 3/3] =?UTF-8?q?testpopover:=20Don=E2=80=99t=20set=20margin?= =?UTF-8?q?=20in=20menu=20box?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gizmo already provides sufficient padding. --- tests/popover2.ui | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/popover2.ui b/tests/popover2.ui index 5ab488cdb2..2e406fb751 100644 --- a/tests/popover2.ui +++ b/tests/popover2.ui @@ -5,7 +5,6 @@ True vertical - 10 True