]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
kconfig: gconf: use configure-event handler to adjust pane separator
authorMasahiro Yamada <masahiroy@kernel.org>
Sun, 29 Jun 2025 18:43:28 +0000 (03:43 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 26 Jul 2025 06:31:29 +0000 (15:31 +0900)
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>
scripts/kconfig/gconf.c

index 7397a51641a79741bf30e84ee6f8a5fd1430110e..37eec7a6bf544e3a00bbeb5c59244ca26151cb6c 100644 (file)
@@ -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);