Skip to content

Commit 06ba76d

Browse files
committed
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 <[email protected]> Tested-by: Randy Dunlap <[email protected]>
1 parent 0c82f50 commit 06ba76d

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

scripts/kconfig/gconf.c

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -606,23 +606,12 @@ static void on_window1_destroy(GtkObject *object, gpointer user_data)
606606
gtk_main_quit();
607607
}
608608

609-
static void on_window1_size_request(GtkWidget *widget,
610-
GtkRequisition *requisition,
611-
gpointer user_data)
609+
static gboolean on_window1_configure(GtkWidget *self,
610+
GdkEventConfigure *event,
611+
gpointer user_data)
612612
{
613-
static gint old_h;
614-
gint w, h;
615-
616-
if (widget->window == NULL)
617-
gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, &h);
618-
else
619-
gdk_window_get_size(widget->window, &w, &h);
620-
621-
if (h == old_h)
622-
return;
623-
old_h = h;
624-
625-
gtk_paned_set_position(GTK_PANED(vpaned), 2 * h / 3);
613+
gtk_paned_set_position(GTK_PANED(vpaned), 2 * event->height / 3);
614+
return FALSE;
626615
}
627616

628617
static gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
@@ -1023,8 +1012,8 @@ static void init_main_window(const gchar *glade_file)
10231012
main_wnd = glade_xml_get_widget(xml, "window1");
10241013
g_signal_connect(main_wnd, "destroy",
10251014
G_CALLBACK(on_window1_destroy), NULL);
1026-
g_signal_connect(main_wnd, "size_request",
1027-
G_CALLBACK(on_window1_size_request), NULL);
1015+
g_signal_connect(main_wnd, "configure-event",
1016+
G_CALLBACK(on_window1_configure), NULL);
10281017
g_signal_connect(main_wnd, "delete_event",
10291018
G_CALLBACK(on_window1_delete_event), NULL);
10301019

0 commit comments

Comments
 (0)