Subject: 29.0.50; [PATCH] Fix resize of xwidgets on GTK

From: Po Lu <[email-masked]>
Date: Mon, 08 Nov 2021 13:31:17 +0800

gtk_container_resize_children doesn't always work, and the canonical way
to force a re-allocation is to just call gtk_widget_queue_allocate.

>From 5e5cf7276736ddf82d7b56e507500f4267a794ee Mon Sep 17 00:00:00 2001
From: Po Lu <[email-masked]>
Date: Mon, 8 Nov 2021 13:29:44 +0800
Subject: [PATCH] Fix resize of xwidgets on GTK

* src/xwidget.c (Fxwidget_resize): Queue widget for re-allocation
after setting its size request.
---
 src/xwidget.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/xwidget.c b/src/xwidget.c
index ecb973f485..1815a39ab6 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -1740,9 +1740,10 @@ DEFUN ("xwidget-resize", Fxwidget_resize, Sxwidget_resize, 3, 3, 0,
     {
       gtk_window_resize (GTK_WINDOW (xw->widgetwindow_osr), xw->width,
                          xw->height);
-      gtk_container_resize_children (GTK_CONTAINER (xw->widgetwindow_osr));
       gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width,
                                    xw->height);
+
+      gtk_widget_queue_allocate (GTK_WIDGET (xw->widget_osr));
     }
 #elif defined NS_IMPL_COCOA
   nsxwidget_resize (xw);
-- 
2.31.1