summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2025-06-30 03:43:28 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2025-07-26 15:31:29 +0900
commit06ba76dc825703fa61cee72c2ae66508ef5f10ec (patch)
tree174e5927cdc42bd6cc97093dc712a27ae8c0fb79 /scripts
parent0c82f50a06aa13e6fc29e17081094489d57745fd (diff)
kconfig: gconf: use configure-event handler to adjust pane separator
The size-request event handler is currently used to adjust the position of the horizontal separator in the right pane. However, the size-request signal is not available in GTK 3. Use the configure-event signal instead. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Randy Dunlap <rdunlap@infradead.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/gconf.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 7397a51641a7..37eec7a6bf54 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -606,23 +606,12 @@ static void on_window1_destroy(GtkObject *object, gpointer user_data)
gtk_main_quit();
}
-static void on_window1_size_request(GtkWidget *widget,
- GtkRequisition *requisition,
- gpointer user_data)
+static gboolean on_window1_configure(GtkWidget *self,
+ GdkEventConfigure *event,
+ gpointer user_data)
{
- static gint old_h;
- gint w, 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;
-
- gtk_paned_set_position(GTK_PANED(vpaned), 2 * h / 3);
+ gtk_paned_set_position(GTK_PANED(vpaned), 2 * event->height / 3);
+ return FALSE;
}
static gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
@@ -1023,8 +1012,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, "configure-event",
+ G_CALLBACK(on_window1_configure), NULL);
g_signal_connect(main_wnd, "delete_event",
G_CALLBACK(on_window1_delete_event), NULL);