#if defined(FEAT_GUI_GTK) && defined(USE_GTK4)
int decor_height;
+ // Size of the form widget last asked for with gui_mch_set_shellsize().
+ // "pending_form_skip" counts how many allocations that do not answer it
+ // may still be ignored.
+ int pending_form_w;
+ int pending_form_h;
+ int pending_form_skip;
+
// Used for clipboard functionality in GTK4 GUI
GdkContentProvider *regular_provider;
GdkContentProvider *primary_provider;
int base_width UNUSED, int base_height UNUSED,
int direction UNUSED)
{
+ // Remember the size the form widget is supposed to get. An allocation
+ // that arrives before the compositor has answered this request still has
+ // the previous size and must not be used.
+ gui.pending_form_w = width;
+ gui.pending_form_h = height;
+ gui.pending_form_skip = 1;
+
width += get_menu_tool_width();
height += get_menu_tool_height();
goto exit;
if (self->last_width > 1 && self->last_height > 1)
+ {
+ // Ignore an allocation that does not answer the size that was last
+ // asked for: it was computed before the request and using it would
+ // compute Rows and Columns from the old size together with the new
+ // base size, losing columns. Give up after one allocation in case
+ // the request is never answered exactly.
+ if (gui.pending_form_w > 0
+ && (self->last_width != gui.pending_form_w
+ || self->last_height != gui.pending_form_h)
+ && --gui.pending_form_skip >= 0)
+ goto exit;
+
+ gui.pending_form_w = 0;
gui_resize_shell(self->last_width, self->last_height);
+ }
exit:
g_object_unref(self);
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 940,
/**/
939,
/**/