[PATCH 53/66] kconfig: gconf: use size_allocate event handler

From: Masahiro Yamada
Date: Tue Jun 24 2025 - 11:24:13 EST


The size_request event is not available in GTK 3. Use the size_allocate
event handler instead.

Signed-off-by: Masahiro Yamada <masahiroy@xxxxxxxxxx>
---

scripts/kconfig/gconf.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index b86d54c222e3..6487d6a0dd9d 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -660,21 +660,13 @@ static void on_window1_destroy(GtkObject *object, gpointer user_data)
gtk_main_quit();
}

-static void on_window1_size_request(GtkWidget *widget,
- GtkRequisition *requisition,
+static void on_window_size_allocate(GtkWidget *widget,
+ GtkAllocation *allocation,
gpointer user_data)
{
- static gint old_h;
- gint w, h;
+ gint h;

- if (widget->window == NULL)
- gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, &h);
- else
- gdk_window_get_size(widget->window, &w, &h);
-
- if (h == old_h)
- return;
- old_h = h;
+ h = allocation->height;

gtk_paned_set_position(GTK_PANED(vpaned), 2 * h / 3);
}
@@ -1000,8 +992,8 @@ static void init_main_window(const gchar *glade_file)
main_wnd = glade_xml_get_widget(xml, "window1");
g_signal_connect(main_wnd, "destroy",
G_CALLBACK(on_window1_destroy), NULL);
- g_signal_connect(main_wnd, "size_request",
- G_CALLBACK(on_window1_size_request), NULL);
+ g_signal_connect(main_wnd, "size_allocate",
+ G_CALLBACK(on_window_size_allocate), NULL);
g_signal_connect(main_wnd, "delete_event",
G_CALLBACK(on_window1_delete_event), NULL);

--
2.43.0