linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/66] kconfig: improve xconfig and gconfig
@ 2025-06-24 15:04 Masahiro Yamada
  2025-06-24 15:04 ` [PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed Masahiro Yamada
                   ` (66 more replies)
  0 siblings, 67 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:04 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

[xconfig]

 - small improvement for choice

[gconfig]

 - Fix memory leak
 - Lots of refactoring
 - Migrate GTK 2 to GTK 3
 - Fix all compile warnings
 - Improve usability (grey out buttons, keep the item selection, etc.)



Masahiro Yamada (66):
  kconfig: set MENU_CHANGED to choice when the selected member is
    changed
  kconfig: qconf: do not show checkbox icon for choice
  kconfig: qconf: show selected choice in the Value column
  kconfig: rename menu_get_parent_menu() to
    menu_get_menu_or_parent_menu()
  kconfig: re-add menu_get_parent_menu() that returns parent menu
  kconfig: gconf: make columns resizable
  kconfig: gconf: fix potential memory leak in renderer_edited()
  kconfig: gconf: always destroy dialog in on_window1_delete_event()
  kconfig: gconf: remove old #ifdef GTK_CHECK_VERSION
  kconfig: gconf: remove empty if-block
  kconfig: gconf: remove meaningless code in init_main_window()
  kconfig: gconf: remove unneeded gtk_tree_view_set_headers_visible()
    calls
  kconfig: gconf: remove gtk_tree_view_column_set_visible() calls
  kconfig: gconf: remove gtk_widget_realize() calls
  kconfig: gconf: remove gtk_tree_view_set_rules_hint() calls
  kconfig: gconf: remove unnecessary gtk_set_locale() call
  kconfig: gconf: remove internal-child="image" nodes from glade
  kconfig: gconf: remove parents[] array and indent variable
  kconfig: gconf: remove unnecessary NULL checks for tree1 and tree2
  kconfig: gconf: remove unneeded variable in on_split_clicked()
  kconfig: gconf: remove unneeded variables in
    on_treeview*_button_press_event()
  kconfig: gconf: remove unused 'color' variable
  kconfig: gconf: add static qualifiers to variables
  kconfig: gconf: move init_*() functions below
  kconfig: gconf: refactor view setting code
  kconfig: gconf: grey out button for current view
  kconfig: gconf: move the main window event handlers below
  kconfig: gconf: move button1 initialization below
  kconfig: gconf: add static qualifiers to event handlers
  kconfig: gconf: remove glade_xml_signal_autoconnect() call
  kconfig: gconf: make key_press_event work in left pane too
  kconfig: gconf: avoid hardcoding model2 in
    on_treeview2_cursor_changed()
  kconfig: gconf: avoid hardcoding model2 in renderer_edited()
  kconfig: gconf: avoid hardcoding model* in
    on_treeview*_button_press_event()
  kconfig: gconf: add on_save_clicked() event handler
  kconfig: gconf: use GtkFileChooser in on_load1_activate()
  kconfig: gconf: use GtkFileChooser in on_save_as1_activate()
  kconfig: gconf: use GdkPixbuf in replace_button_icon()
  kconfig: gconf: refactor replace_button_icon()
  kconfig: gconf: make introduction, about, license dialogs modal
  kconfig: gconf: remove global 'tree' variable
  kconfig: gconf: merge 'current' and 'browsed' global variables
  kconfig: gconf: preserve menu selection when switching view mode
  kconfig: gconf: use GtkTreeModelFilter to control row visibility
  kconfig: gconf: remove global 'model1' and 'model2' variables
  kconfig: gconf: remove init_tree_model()
  kconfig: gconf: inline fill_row() into set_node()
  kconfig: gconf: do not reconstruct tree store when a symbol is changed
  kconfig: gconf: inline display_list() into set_view_mode()
  kconfig: gconf: remove dead code in display_tree_part()
  kconfig: gconf: rename display_tree_part()
  kconfig: gconf: remove fixup_rootmenu()
  kconfig: gconf: use size_allocate event handler
  kconfig: gconf: replace GDK_space with GDK_KEY_space
  kconfig: gconf: replace GTK_STOCK_{OK,NO,CANCEL}
  kconfig: gconf: remove "tooltips" property from glade
  kconfig: gconf: replace "tooltip" property with "tooltip-text"
  kconfig: gconf: remove unnecessary default message in text view
  kconfig: gconf: use gtk_check_menu_item_get_active() accessor
  kconfig: gconf: use gtk_dialog_get_content_area() accessor
  kconfig: gconf: remove GtkHandleBox from glade
  kconfig: gconf: rename gconf.glade to gconf.ui
  kconfig: gconf: migrate to GTK 3
  kconfig: gconf: replace GtkVbox with GtkBox
  kconfig: gconf: replace GdkColor with GdkRGBA
  kconfig: gconf: show GTK version in About dialog

 scripts/kconfig/conf.c                    |    2 +-
 scripts/kconfig/gconf-cfg.sh              |   11 +-
 scripts/kconfig/gconf.c                   | 1828 ++++++++++-----------
 scripts/kconfig/{gconf.glade => gconf.ui} |  360 ++--
 scripts/kconfig/lkc.h                     |    1 +
 scripts/kconfig/menu.c                    |   20 +
 scripts/kconfig/qconf.cc                  |   26 +-
 scripts/kconfig/symbol.c                  |    4 +
 8 files changed, 1023 insertions(+), 1229 deletions(-)
 rename scripts/kconfig/{gconf.glade => gconf.ui} (57%)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 104+ messages in thread

* [PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
@ 2025-06-24 15:04 ` Masahiro Yamada
  2025-06-30  6:34   ` Randy Dunlap
  2025-06-24 15:04 ` [PATCH 02/66] kconfig: qconf: do not show checkbox icon for choice Masahiro Yamada
                   ` (65 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:04 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

In gconf, choice entries display the selected symbol in the 'Value'
column, but it is not updated when the selected symbol is changed.

Set the MENU_CHANGED flag, so it is updated.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/symbol.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index d57f8cbba291..26ab10c0fd76 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -195,6 +195,10 @@ static void sym_set_changed(struct symbol *sym)
 
 	list_for_each_entry(menu, &sym->menus, link)
 		menu->flags |= MENU_CHANGED;
+
+	menu = sym_get_choice_menu(sym);
+	if (menu)
+		menu->flags |= MENU_CHANGED;
 }
 
 static void sym_set_all_changed(void)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 02/66] kconfig: qconf: do not show checkbox icon for choice
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
  2025-06-24 15:04 ` [PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed Masahiro Yamada
@ 2025-06-24 15:04 ` Masahiro Yamada
  2025-06-29 20:15   ` Randy Dunlap
  2025-06-30  0:51   ` Randy Dunlap
  2025-06-24 15:04 ` [PATCH 03/66] kconfig: qconf: show selected choice in the Value column Masahiro Yamada
                   ` (64 subsequent siblings)
  66 siblings, 2 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:04 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

When you select "Show All Options" or "Show Prompt Options", choice
entries display a check box icon, but this has no point because
choice is always y since commit

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/qconf.cc | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index eaa465b0ccf9..546738a5c3b1 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -92,7 +92,6 @@ void ConfigItem::updateMenu(void)
 {
 	ConfigList* list;
 	struct symbol* sym;
-	struct property *prop;
 	QString prompt;
 	int type;
 	tristate expr;
@@ -105,11 +104,10 @@ void ConfigItem::updateMenu(void)
 	}
 
 	sym = menu->sym;
-	prop = menu->prompt;
 	prompt = menu_get_prompt(menu);
 
-	if (prop) switch (prop->type) {
-	case P_MENU:
+	switch (menu->type) {
+	case M_MENU:
 		if (list->mode == singleMode) {
 			/* a menuconfig entry is displayed differently
 			 * depending whether it's at the view root or a child.
@@ -123,10 +121,13 @@ void ConfigItem::updateMenu(void)
 			setIcon(promptColIdx, QIcon());
 		}
 		goto set_prompt;
-	case P_COMMENT:
+	case M_COMMENT:
 		setIcon(promptColIdx, QIcon());
 		prompt = "*** " + prompt + " ***";
 		goto set_prompt;
+	case M_CHOICE:
+		setIcon(promptColIdx, QIcon());
+		goto set_prompt;
 	default:
 		;
 	}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 03/66] kconfig: qconf: show selected choice in the Value column
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
  2025-06-24 15:04 ` [PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed Masahiro Yamada
  2025-06-24 15:04 ` [PATCH 02/66] kconfig: qconf: do not show checkbox icon for choice Masahiro Yamada
@ 2025-06-24 15:04 ` Masahiro Yamada
  2025-06-30  0:56   ` Randy Dunlap
  2025-06-24 15:04 ` [PATCH 04/66] kconfig: rename menu_get_parent_menu() to menu_get_menu_or_parent_menu() Masahiro Yamada
                   ` (63 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:04 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

It is useful to display the selected choice's value in the Value column.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/qconf.cc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 546738a5c3b1..68640e507ec4 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -127,6 +127,9 @@ void ConfigItem::updateMenu(void)
 		goto set_prompt;
 	case M_CHOICE:
 		setIcon(promptColIdx, QIcon());
+		sym = sym_calc_choice(menu);
+		if (sym)
+			setText(dataColIdx, sym->name);
 		goto set_prompt;
 	default:
 		;
@@ -189,7 +192,11 @@ void ConfigItem::testUpdateMenu(void)
 	if (!menu)
 		return;
 
-	sym_calc_value(menu->sym);
+	if (menu->type == M_CHOICE)
+		sym_calc_choice(menu);
+	else
+		sym_calc_value(menu->sym);
+
 	if (menu->flags & MENU_CHANGED) {
 		/* the menu entry changed, so update all list items */
 		menu->flags &= ~MENU_CHANGED;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 04/66] kconfig: rename menu_get_parent_menu() to menu_get_menu_or_parent_menu()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (2 preceding siblings ...)
  2025-06-24 15:04 ` [PATCH 03/66] kconfig: qconf: show selected choice in the Value column Masahiro Yamada
@ 2025-06-24 15:04 ` Masahiro Yamada
  2025-06-30  0:58   ` Randy Dunlap
  2025-06-24 15:04 ` [PATCH 05/66] kconfig: re-add menu_get_parent_menu() that returns parent menu Masahiro Yamada
                   ` (62 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:04 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The current menu_get_parent_menu() does not always return the parent
menu; if the given argument is itself a menu, it returns that menu.

Rename this function to better reflect this behavior.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/conf.c   | 2 +-
 scripts/kconfig/lkc.h    | 2 +-
 scripts/kconfig/menu.c   | 8 +++++++-
 scripts/kconfig/qconf.cc | 6 +++---
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 8abe57041955..a7b44cd8ae14 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -594,7 +594,7 @@ static void check_conf(struct menu *menu)
 		default:
 			if (!conf_cnt++)
 				printf("*\n* Restart config...\n*\n");
-			rootEntry = menu_get_parent_menu(menu);
+			rootEntry = menu_get_menu_or_parent_menu(menu);
 			conf(rootEntry);
 			break;
 		}
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index fbc907f75eac..5cc85c3d4aaa 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -97,7 +97,7 @@ bool menu_is_empty(struct menu *menu);
 bool menu_is_visible(struct menu *menu);
 bool menu_has_prompt(const struct menu *menu);
 const char *menu_get_prompt(const struct menu *menu);
-struct menu *menu_get_parent_menu(struct menu *menu);
+struct menu *menu_get_menu_or_parent_menu(struct menu *menu);
 int get_jump_key_char(void);
 struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head);
 void menu_get_ext_help(struct menu *menu, struct gstr *help);
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 7d48a692bd27..ccb690bbf05d 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -575,7 +575,13 @@ const char *menu_get_prompt(const struct menu *menu)
 	return NULL;
 }
 
-struct menu *menu_get_parent_menu(struct menu *menu)
+/**
+ * menu_get_menu_or_parent_menu - return the parent menu or the menu itself
+ * @menu: pointer to the menu
+ * return: the parent menu. If the given argument is already a menu, return
+ *         itself.
+ */
+struct menu *menu_get_menu_or_parent_menu(struct menu *menu)
 {
 	enum prop_type type;
 
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 68640e507ec4..dc056b0a8fde 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -577,7 +577,7 @@ void ConfigList::setParentMenu(void)
 	oldroot = rootEntry;
 	if (rootEntry == &rootmenu)
 		return;
-	setRootMenu(menu_get_parent_menu(rootEntry->parent));
+	setRootMenu(menu_get_menu_or_parent_menu(rootEntry->parent));
 
 	QTreeWidgetItemIterator it(this);
 	while (*it) {
@@ -1540,7 +1540,7 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
 	switch (configList->mode) {
 	case singleMode:
 		list = configList;
-		parent = menu_get_parent_menu(menu);
+		parent = menu_get_menu_or_parent_menu(menu);
 		if (!parent)
 			return;
 		list->setRootMenu(parent);
@@ -1551,7 +1551,7 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
 			configList->clearSelection();
 			list = configList;
 		} else {
-			parent = menu_get_parent_menu(menu->parent);
+			parent = menu_get_menu_or_parent_menu(menu->parent);
 			if (!parent)
 				return;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 05/66] kconfig: re-add menu_get_parent_menu() that returns parent menu
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (3 preceding siblings ...)
  2025-06-24 15:04 ` [PATCH 04/66] kconfig: rename menu_get_parent_menu() to menu_get_menu_or_parent_menu() Masahiro Yamada
@ 2025-06-24 15:04 ` Masahiro Yamada
  2025-06-30  0:59   ` Randy Dunlap
  2025-06-24 15:04 ` [PATCH 06/66] kconfig: gconf: make columns resizable Masahiro Yamada
                   ` (61 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:04 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This helper returns the parent menu, or NULL if there is no parent.
The main difference from the previous version is that it always returns
the parent menu even when the given argument is itself a menu.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/lkc.h  |  1 +
 scripts/kconfig/menu.c | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 5cc85c3d4aaa..37b606c74bff 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -97,6 +97,7 @@ bool menu_is_empty(struct menu *menu);
 bool menu_is_visible(struct menu *menu);
 bool menu_has_prompt(const struct menu *menu);
 const char *menu_get_prompt(const struct menu *menu);
+struct menu *menu_get_parent_menu(struct menu *menu);
 struct menu *menu_get_menu_or_parent_menu(struct menu *menu);
 int get_jump_key_char(void);
 struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head);
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index ccb690bbf05d..a5e5b4fdcd93 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -575,6 +575,20 @@ const char *menu_get_prompt(const struct menu *menu)
 	return NULL;
 }
 
+/**
+ * menu_get_parent_menu - return the parent menu or NULL
+ * @menu: pointer to the menu
+ * return: the parent menu, or NULL if there is no parent.
+ */
+struct menu *menu_get_parent_menu(struct menu *menu)
+{
+	for (menu = menu->parent; menu; menu = menu->parent)
+		if (menu->type == M_MENU)
+			return menu;
+
+	return NULL;
+}
+
 /**
  * menu_get_menu_or_parent_menu - return the parent menu or the menu itself
  * @menu: pointer to the menu
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 06/66] kconfig: gconf: make columns resizable
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (4 preceding siblings ...)
  2025-06-24 15:04 ` [PATCH 05/66] kconfig: re-add menu_get_parent_menu() that returns parent menu Masahiro Yamada
@ 2025-06-24 15:04 ` Masahiro Yamada
  2025-06-30  2:18   ` Randy Dunlap
  2025-06-24 15:04 ` [PATCH 07/66] kconfig: gconf: fix potential memory leak in renderer_edited() Masahiro Yamada
                   ` (60 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:04 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The variable "resizeable" is a typo and always set to FALSE, resulting
in dead code in init_right_tree(). It is unclear column resizing should
be disabled. Enable it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index c0f46f189060..a3978d3420d1 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -30,7 +30,6 @@ static gint view_mode = FULL_VIEW;
 static gboolean show_name = TRUE;
 static gboolean show_range = TRUE;
 static gboolean show_value = TRUE;
-static gboolean resizeable = FALSE;
 static int opt_mode = OPT_NORMAL;
 
 GtkWidget *main_wnd = NULL;
@@ -312,11 +311,9 @@ static void init_right_tree(void)
 	column = gtk_tree_view_get_column(view, COL_VALUE);
 	gtk_tree_view_column_set_visible(column, show_value);
 
-	if (resizeable) {
-		for (i = 0; i < COL_VALUE; i++) {
-			column = gtk_tree_view_get_column(view, i);
-			gtk_tree_view_column_set_resizable(column, TRUE);
-		}
+	for (i = 0; i < COL_VALUE; i++) {
+		column = gtk_tree_view_get_column(view, i);
+		gtk_tree_view_column_set_resizable(column, TRUE);
 	}
 
 	sel = gtk_tree_view_get_selection(view);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 07/66] kconfig: gconf: fix potential memory leak in renderer_edited()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (5 preceding siblings ...)
  2025-06-24 15:04 ` [PATCH 06/66] kconfig: gconf: make columns resizable Masahiro Yamada
@ 2025-06-24 15:04 ` Masahiro Yamada
  2025-06-30  2:21   ` Randy Dunlap
  2025-06-24 15:04 ` [PATCH 08/66] kconfig: gconf: always destroy dialog in on_window1_delete_event() Masahiro Yamada
                   ` (59 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:04 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

If gtk_tree_model_get_iter() fails, gtk_tree_path_free() is not called.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index a3978d3420d1..769f38307f34 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -745,7 +745,7 @@ static void renderer_edited(GtkCellRendererText * cell,
 	struct symbol *sym;
 
 	if (!gtk_tree_model_get_iter(model2, &iter, path))
-		return;
+		goto free;
 
 	gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
 	sym = menu->sym;
@@ -757,6 +757,7 @@ static void renderer_edited(GtkCellRendererText * cell,
 
 	update_tree(&rootmenu, NULL);
 
+free:
 	gtk_tree_path_free(path);
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 08/66] kconfig: gconf: always destroy dialog in on_window1_delete_event()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (6 preceding siblings ...)
  2025-06-24 15:04 ` [PATCH 07/66] kconfig: gconf: fix potential memory leak in renderer_edited() Masahiro Yamada
@ 2025-06-24 15:04 ` Masahiro Yamada
  2025-06-30  2:23   ` Randy Dunlap
  2025-06-24 15:04 ` [PATCH 09/66] kconfig: gconf: remove old #ifdef GTK_CHECK_VERSION Masahiro Yamada
                   ` (58 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:04 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

When gtk_dialog_run() returns GTK_RESPONSE_YES or GTK_RESPONSE_NO,
gtk_widget_destroy() is not called, resulting is a memory leak.

It is better to always destroy the dialog, even if the application
is about to exit.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 769f38307f34..52d439a5119b 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -378,6 +378,7 @@ gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event,
 {
 	GtkWidget *dialog, *label;
 	gint result;
+	gint ret = FALSE;
 
 	if (!conf_get_changed())
 		return FALSE;
@@ -404,17 +405,19 @@ gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event,
 	switch (result) {
 	case GTK_RESPONSE_YES:
 		on_save_activate(NULL, NULL);
-		return FALSE;
+		break;
 	case GTK_RESPONSE_NO:
-		return FALSE;
+		break;
 	case GTK_RESPONSE_CANCEL:
 	case GTK_RESPONSE_DELETE_EVENT:
 	default:
-		gtk_widget_destroy(dialog);
-		return TRUE;
+		ret = TRUE;
+		break;
 	}
 
-	return FALSE;
+	gtk_widget_destroy(dialog);
+
+	return ret;
 }
 
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 09/66] kconfig: gconf: remove old #ifdef GTK_CHECK_VERSION
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (7 preceding siblings ...)
  2025-06-24 15:04 ` [PATCH 08/66] kconfig: gconf: always destroy dialog in on_window1_delete_event() Masahiro Yamada
@ 2025-06-24 15:04 ` Masahiro Yamada
  2025-06-24 15:04 ` [PATCH 10/66] kconfig: gconf: remove empty if-block Masahiro Yamada
                   ` (57 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:04 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

Remove old code.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 52d439a5119b..b2a0208b0a5f 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -849,16 +849,12 @@ on_treeview2_button_press_event(GtkWidget * widget,
 	struct menu *menu;
 	gint col;
 
-#if GTK_CHECK_VERSION(2,1,4) // bug in ctree with earlier version of GTK
 	gint tx = (gint) event->x;
 	gint ty = (gint) event->y;
 	gint cx, cy;
 
 	gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, &cx,
 				      &cy);
-#else
-	gtk_tree_view_get_cursor(view, &path, &column);
-#endif
 	if (path == NULL)
 		return FALSE;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 10/66] kconfig: gconf: remove empty if-block
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (8 preceding siblings ...)
  2025-06-24 15:04 ` [PATCH 09/66] kconfig: gconf: remove old #ifdef GTK_CHECK_VERSION Masahiro Yamada
@ 2025-06-24 15:04 ` Masahiro Yamada
  2025-06-30  2:25   ` Randy Dunlap
  2025-06-24 15:04 ` [PATCH 11/66] kconfig: gconf: remove meaningless code in init_main_window() Masahiro Yamada
                   ` (56 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:04 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This if-block is empty.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index b2a0208b0a5f..7960c456e3b9 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -913,8 +913,6 @@ on_treeview2_key_press_event(GtkWidget * widget,
 			gtk_tree_view_expand_row(view, path, FALSE);
 		return TRUE;
 	}
-	if (event->keyval == GDK_KP_Enter) {
-	}
 	if (widget == tree1_w)
 		return FALSE;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 11/66] kconfig: gconf: remove meaningless code in init_main_window()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (9 preceding siblings ...)
  2025-06-24 15:04 ` [PATCH 10/66] kconfig: gconf: remove empty if-block Masahiro Yamada
@ 2025-06-24 15:04 ` Masahiro Yamada
  2025-06-30  2:25   ` Randy Dunlap
  2025-06-24 15:05 ` [PATCH 12/66] kconfig: gconf: remove unneeded gtk_tree_view_set_headers_visible() calls Masahiro Yamada
                   ` (55 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:04 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The 'widget' variable is set, but not used in later code.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 7960c456e3b9..4b5befa4f685 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -129,7 +129,6 @@ static void init_main_window(const gchar *glade_file)
 	conf_set_changed_callback(conf_changed);
 
 	style = gtk_widget_get_style(main_wnd);
-	widget = glade_xml_get_widget(xml, "toolbar1");
 
 	replace_button_icon(xml, main_wnd->window, style,
 			    "button4", (gchar **) xpm_single_view);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 12/66] kconfig: gconf: remove unneeded gtk_tree_view_set_headers_visible() calls
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (10 preceding siblings ...)
  2025-06-24 15:04 ` [PATCH 11/66] kconfig: gconf: remove meaningless code in init_main_window() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 13/66] kconfig: gconf: remove gtk_tree_view_column_set_visible() calls Masahiro Yamada
                   ` (54 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The headers are visible by default.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 4b5befa4f685..32e5e9054846 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -189,7 +189,6 @@ static void init_left_tree(void)
 	GtkTreeViewColumn *column;
 
 	gtk_tree_view_set_model(view, model1);
-	gtk_tree_view_set_headers_visible(view, TRUE);
 	gtk_tree_view_set_rules_hint(view, TRUE);
 
 	column = gtk_tree_view_column_new();
@@ -232,7 +231,6 @@ static void init_right_tree(void)
 	gint i;
 
 	gtk_tree_view_set_model(view, model2);
-	gtk_tree_view_set_headers_visible(view, TRUE);
 	gtk_tree_view_set_rules_hint(view, TRUE);
 
 	column = gtk_tree_view_column_new();
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 13/66] kconfig: gconf: remove gtk_tree_view_column_set_visible() calls
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (11 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 12/66] kconfig: gconf: remove unneeded gtk_tree_view_set_headers_visible() calls Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 14/66] kconfig: gconf: remove gtk_widget_realize() calls Masahiro Yamada
                   ` (53 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The columns are visible by default.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 32e5e9054846..a027f0f10af9 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -297,17 +297,6 @@ static void init_right_tree(void)
 	g_signal_connect(G_OBJECT(renderer), "edited",
 			 G_CALLBACK(renderer_edited), NULL);
 
-	column = gtk_tree_view_get_column(view, COL_NAME);
-	gtk_tree_view_column_set_visible(column, show_name);
-	column = gtk_tree_view_get_column(view, COL_NO);
-	gtk_tree_view_column_set_visible(column, show_range);
-	column = gtk_tree_view_get_column(view, COL_MOD);
-	gtk_tree_view_column_set_visible(column, show_range);
-	column = gtk_tree_view_get_column(view, COL_YES);
-	gtk_tree_view_column_set_visible(column, show_range);
-	column = gtk_tree_view_get_column(view, COL_VALUE);
-	gtk_tree_view_column_set_visible(column, show_value);
-
 	for (i = 0; i < COL_VALUE; i++) {
 		column = gtk_tree_view_get_column(view, i);
 		gtk_tree_view_column_set_resizable(column, TRUE);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 14/66] kconfig: gconf: remove gtk_widget_realize() calls
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (12 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 13/66] kconfig: gconf: remove gtk_tree_view_column_set_visible() calls Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 15/66] kconfig: gconf: remove gtk_tree_view_set_rules_hint() calls Masahiro Yamada
                   ` (52 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This function is primarily used in widget implementations, and isn't
very useful otherwise.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index a027f0f10af9..3f9b9957f089 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -215,7 +215,6 @@ static void init_left_tree(void)
 
 	sel = gtk_tree_view_get_selection(view);
 	gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE);
-	gtk_widget_realize(tree1_w);
 }
 
 static void renderer_edited(GtkCellRendererText * cell,
@@ -967,7 +966,6 @@ on_treeview1_button_press_event(GtkWidget * widget,
 		display_tree_part();
 	}
 
-	gtk_widget_realize(tree2_w);
 	gtk_tree_view_set_cursor(view, path, NULL, FALSE);
 	gtk_widget_grab_focus(tree2_w);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 15/66] kconfig: gconf: remove gtk_tree_view_set_rules_hint() calls
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (13 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 14/66] kconfig: gconf: remove gtk_widget_realize() calls Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 16/66] kconfig: gconf: remove unnecessary gtk_set_locale() call Masahiro Yamada
                   ` (51 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The use of the this function is not recommended, and it has been
deprecated since GTK 3.14.

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/3.14.0/gtk/gtktreeview.c#L11891

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 3f9b9957f089..4bbc8f87deb6 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -189,7 +189,6 @@ static void init_left_tree(void)
 	GtkTreeViewColumn *column;
 
 	gtk_tree_view_set_model(view, model1);
-	gtk_tree_view_set_rules_hint(view, TRUE);
 
 	column = gtk_tree_view_column_new();
 	gtk_tree_view_append_column(view, column);
@@ -230,7 +229,6 @@ static void init_right_tree(void)
 	gint i;
 
 	gtk_tree_view_set_model(view, model2);
-	gtk_tree_view_set_rules_hint(view, TRUE);
 
 	column = gtk_tree_view_column_new();
 	gtk_tree_view_append_column(view, column);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 16/66] kconfig: gconf: remove unnecessary gtk_set_locale() call
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (14 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 15/66] kconfig: gconf: remove gtk_tree_view_set_rules_hint() calls Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 17/66] kconfig: gconf: remove internal-child="image" nodes from glade Masahiro Yamada
                   ` (50 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

gtk_set_locale() has been deprecated since version 2.24, and setlocale()
should be used directly. [1]

However, gtk_init() automatically does this, so there is typically no
point in calling this function.

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtkmain.c#L1152

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 4bbc8f87deb6..3e632a325c10 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -1367,7 +1367,6 @@ int main(int ac, char *av[])
 	gchar *glade_file;
 
 	/* GTK stuffs */
-	gtk_set_locale();
 	gtk_init(&ac, &av);
 	glade_init();
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 17/66] kconfig: gconf: remove internal-child="image" nodes from glade
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (15 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 16/66] kconfig: gconf: remove unnecessary gtk_set_locale() call Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 18/66] kconfig: gconf: remove parents[] array and indent variable Masahiro Yamada
                   ` (49 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

These nodes do not appear to serve anything useful.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.glade | 84 -------------------------------------
 1 file changed, 84 deletions(-)

diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.glade
index aa483cb32755..19b80f2ec1ff 100644
--- a/scripts/kconfig/gconf.glade
+++ b/scripts/kconfig/gconf.glade
@@ -48,18 +48,6 @@
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_load1_activate"/>
 		      <accelerator key="L" modifiers="GDK_CONTROL_MASK" signal="activate"/>
-
-		      <child internal-child="image">
-			<widget class="GtkImage" id="image39">
-			  <property name="visible">True</property>
-			  <property name="stock">gtk-open</property>
-			  <property name="icon_size">1</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-		      </child>
 		    </widget>
 		  </child>
 
@@ -71,18 +59,6 @@
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_save_activate"/>
 		      <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/>
-
-		      <child internal-child="image">
-			<widget class="GtkImage" id="image40">
-			  <property name="visible">True</property>
-			  <property name="stock">gtk-save</property>
-			  <property name="icon_size">1</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-		      </child>
 		    </widget>
 		  </child>
 
@@ -93,18 +69,6 @@
 		      <property name="label" translatable="yes">Save _as</property>
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_save_as1_activate"/>
-
-		      <child internal-child="image">
-			<widget class="GtkImage" id="image41">
-			  <property name="visible">True</property>
-			  <property name="stock">gtk-save-as</property>
-			  <property name="icon_size">1</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-		      </child>
 		    </widget>
 		  </child>
 
@@ -121,18 +85,6 @@
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_quit1_activate"/>
 		      <accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
-
-		      <child internal-child="image">
-			<widget class="GtkImage" id="image42">
-			  <property name="visible">True</property>
-			  <property name="stock">gtk-quit</property>
-			  <property name="icon_size">1</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-		      </child>
 		    </widget>
 		  </child>
 		</widget>
@@ -244,18 +196,6 @@
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_introduction1_activate" last_modification_time="Fri, 15 Nov 2002 20:26:30 GMT"/>
 		      <accelerator key="I" modifiers="GDK_CONTROL_MASK" signal="activate"/>
-
-		      <child internal-child="image">
-			<widget class="GtkImage" id="image43">
-			  <property name="visible">True</property>
-			  <property name="stock">gtk-dialog-question</property>
-			  <property name="icon_size">1</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-		      </child>
 		    </widget>
 		  </child>
 
@@ -266,18 +206,6 @@
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_about1_activate" last_modification_time="Fri, 15 Nov 2002 20:26:30 GMT"/>
 		      <accelerator key="A" modifiers="GDK_CONTROL_MASK" signal="activate"/>
-
-		      <child internal-child="image">
-			<widget class="GtkImage" id="image44">
-			  <property name="visible">True</property>
-			  <property name="stock">gtk-properties</property>
-			  <property name="icon_size">1</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-		      </child>
 		    </widget>
 		  </child>
 
@@ -287,18 +215,6 @@
 		      <property name="label" translatable="yes">_License</property>
 		      <property name="use_underline">True</property>
 		      <signal name="activate" handler="on_license1_activate" last_modification_time="Fri, 15 Nov 2002 20:26:30 GMT"/>
-
-		      <child internal-child="image">
-			<widget class="GtkImage" id="image45">
-			  <property name="visible">True</property>
-			  <property name="stock">gtk-justify-fill</property>
-			  <property name="icon_size">1</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-		      </child>
 		    </widget>
 		  </child>
 		</widget>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 18/66] kconfig: gconf: remove parents[] array and indent variable
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (16 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 17/66] kconfig: gconf: remove internal-child="image" nodes from glade Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 19/66] kconfig: gconf: remove unnecessary NULL checks for tree1 and tree2 Masahiro Yamada
                   ` (48 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The parents[] array is used to store the GtkTreeIter of parent nodes,
but this can be simplified: we can pass a GtkTreeIter pointer down
when _display_tree() recurses.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 3e632a325c10..432a467e3250 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -47,8 +47,6 @@ GdkColor color;
 
 GtkTreeStore *tree1, *tree2, *tree;
 GtkTreeModel *model1, *model2;
-static GtkTreeIter *parents[256];
-static gint indent;
 
 static struct menu *current; // current node for SINGLE view
 static struct menu *browsed; // browsed node for SPLIT view
@@ -153,8 +151,6 @@ static void init_main_window(const gchar *glade_file)
 
 static void init_tree_model(void)
 {
-	gint i;
-
 	tree = tree2 = gtk_tree_store_new(COL_NUMBER,
 					  G_TYPE_STRING, G_TYPE_STRING,
 					  G_TYPE_STRING, G_TYPE_STRING,
@@ -166,9 +162,6 @@ static void init_tree_model(void)
 					  G_TYPE_BOOLEAN);
 	model2 = GTK_TREE_MODEL(tree2);
 
-	for (parents[0] = NULL, i = 1; i < 256; i++)
-		parents[i] = (GtkTreeIter *) g_malloc(sizeof(GtkTreeIter));
-
 	tree1 = gtk_tree_store_new(COL_NUMBER,
 				   G_TYPE_STRING, G_TYPE_STRING,
 				   G_TYPE_STRING, G_TYPE_STRING,
@@ -1131,18 +1124,6 @@ static void set_node(GtkTreeIter * node, struct menu *menu, gchar ** row)
 	g_object_unref(pix);
 }
 
-
-/* Add a node to the tree */
-static void place_node(struct menu *menu, char **row)
-{
-	GtkTreeIter *parent = parents[indent - 1];
-	GtkTreeIter *node = parents[indent];
-
-	gtk_tree_store_append(tree, node, parent);
-	set_node(node, menu, row);
-}
-
-
 /* Find a node in the GTK+ tree */
 static GtkTreeIter found;
 
@@ -1193,9 +1174,6 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
 	struct symbol *sym;
 	struct menu *menu1, *menu2;
 
-	if (src == &rootmenu)
-		indent = 1;
-
 	valid = gtk_tree_model_iter_children(model2, child2, dst);
 	for (child1 = src->list; child1; child1 = child1->next) {
 
@@ -1253,9 +1231,7 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
 			set_node(child2, menu1, fill_row(menu1));
 		}
 
-		indent++;
 		update_tree(child1, child2);
-		indent--;
 
 		valid = gtk_tree_model_iter_next(model2, child2);
 	}
@@ -1263,16 +1239,15 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
 
 
 /* Display the whole tree (single/split/full view) */
-static void display_tree(struct menu *menu)
+static void _display_tree(struct menu *menu, GtkTreeIter *parent)
 {
 	struct property *prop;
 	struct menu *child;
 	enum prop_type ptype;
+	GtkTreeIter iter;
 
-	if (menu == &rootmenu) {
-		indent = 1;
+	if (menu == &rootmenu)
 		current = &rootmenu;
-	}
 
 	for (child = menu->list; child; child = child->next) {
 		prop = child->prompt;
@@ -1290,8 +1265,10 @@ static void display_tree(struct menu *menu)
 
 		if ((opt_mode == OPT_NORMAL && menu_is_visible(child)) ||
 		    (opt_mode == OPT_PROMPT && menu_has_prompt(child)) ||
-		    (opt_mode == OPT_ALL    && menu_get_prompt(child)))
-			place_node(child, fill_row(child));
+		    (opt_mode == OPT_ALL    && menu_get_prompt(child))) {
+			gtk_tree_store_append(tree, &iter, parent);
+			set_node(&iter, child, fill_row(child));
+		}
 
 		if ((view_mode != FULL_VIEW) && (ptype == P_MENU)
 		    && (tree == tree2))
@@ -1308,14 +1285,16 @@ static void display_tree(struct menu *menu)
 
 		if (((view_mode == SINGLE_VIEW) && (menu->flags & MENU_ROOT))
 		    || (view_mode == FULL_VIEW)
-		    || (view_mode == SPLIT_VIEW)) {
-			indent++;
-			display_tree(child);
-			indent--;
-		}
+		    || (view_mode == SPLIT_VIEW))
+			_display_tree(child, &iter);
 	}
 }
 
+static void display_tree(struct menu *menu)
+{
+	_display_tree(menu, NULL);
+}
+
 /* Display a part of the tree starting at current node (single/split view) */
 static void display_tree_part(void)
 {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 19/66] kconfig: gconf: remove unnecessary NULL checks for tree1 and tree2
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (17 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 18/66] kconfig: gconf: remove parents[] array and indent variable Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 20/66] kconfig: gconf: remove unneeded variable in on_split_clicked() Masahiro Yamada
                   ` (47 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The tree1 and tree2 variables are initialized earlier in
init_tree_model(), so the NULL checks are redundant.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 432a467e3250..2ab000adcced 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -678,8 +678,7 @@ void on_split_clicked(GtkButton * button, gpointer user_data)
 	gtk_widget_show(tree1_w);
 	gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, &h);
 	gtk_paned_set_position(GTK_PANED(hpaned), w / 2);
-	if (tree2)
-		gtk_tree_store_clear(tree2);
+	gtk_tree_store_clear(tree2);
 	display_list();
 
 	/* Disable back btn, like in full mode. */
@@ -691,8 +690,7 @@ void on_full_clicked(GtkButton * button, gpointer user_data)
 {
 	view_mode = FULL_VIEW;
 	gtk_widget_hide(tree1_w);
-	if (tree2)
-		gtk_tree_store_clear(tree2);
+	gtk_tree_store_clear(tree2);
 	display_tree(&rootmenu);
 	gtk_widget_set_sensitive(back_btn, FALSE);
 }
@@ -1298,8 +1296,7 @@ static void display_tree(struct menu *menu)
 /* Display a part of the tree starting at current node (single/split view) */
 static void display_tree_part(void)
 {
-	if (tree2)
-		gtk_tree_store_clear(tree2);
+	gtk_tree_store_clear(tree2);
 	if (view_mode == SINGLE_VIEW)
 		display_tree(current);
 	else if (view_mode == SPLIT_VIEW)
@@ -1312,8 +1309,7 @@ static void display_tree_part(void)
 /* Display the list in the left frame (split view) */
 static void display_list(void)
 {
-	if (tree1)
-		gtk_tree_store_clear(tree1);
+	gtk_tree_store_clear(tree1);
 
 	tree = tree1;
 	display_tree(&rootmenu);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 20/66] kconfig: gconf: remove unneeded variable in on_split_clicked()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (18 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 19/66] kconfig: gconf: remove unnecessary NULL checks for tree1 and tree2 Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 21/66] kconfig: gconf: remove unneeded variables in on_treeview*_button_press_event() Masahiro Yamada
                   ` (46 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The height of the window is not used here. Passing NULL to
gtk_window_get_default_size() is allowed. [1]

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtkwindow.c#L3974

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 2ab000adcced..c78eded5c01b 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -673,10 +673,10 @@ void on_single_clicked(GtkButton * button, gpointer user_data)
 
 void on_split_clicked(GtkButton * button, gpointer user_data)
 {
-	gint w, h;
+	gint w;
 	view_mode = SPLIT_VIEW;
 	gtk_widget_show(tree1_w);
-	gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, &h);
+	gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, NULL);
 	gtk_paned_set_position(GTK_PANED(hpaned), w / 2);
 	gtk_tree_store_clear(tree2);
 	display_list();
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 21/66] kconfig: gconf: remove unneeded variables in on_treeview*_button_press_event()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (19 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 20/66] kconfig: gconf: remove unneeded variable in on_split_clicked() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-30  2:40   ` Randy Dunlap
  2025-06-24 15:05 ` [PATCH 22/66] kconfig: gconf: remove unused 'color' variable Masahiro Yamada
                   ` (45 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

No all position parameters are used here. Passing NULL to
gtk_tree_view_get_cursor() or gtk_tree_view_get_path_at_pos() is
allowed. [1] [2]

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12638
[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12795
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index c78eded5c01b..ab2e0df21037 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -822,13 +822,10 @@ on_treeview2_button_press_event(GtkWidget * widget,
 	GtkTreeIter iter;
 	struct menu *menu;
 	gint col;
-
 	gint tx = (gint) event->x;
 	gint ty = (gint) event->y;
-	gint cx, cy;
 
-	gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, &cx,
-				      &cy);
+	gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, NULL, NULL);
 	if (path == NULL)
 		return FALSE;
 
@@ -871,12 +868,11 @@ on_treeview2_key_press_event(GtkWidget * widget,
 {
 	GtkTreeView *view = GTK_TREE_VIEW(widget);
 	GtkTreePath *path;
-	GtkTreeViewColumn *column;
 	GtkTreeIter iter;
 	struct menu *menu;
 	gint col;
 
-	gtk_tree_view_get_cursor(view, &path, &column);
+	gtk_tree_view_get_cursor(view, &path, NULL);
 	if (path == NULL)
 		return FALSE;
 
@@ -930,16 +926,12 @@ on_treeview1_button_press_event(GtkWidget * widget,
 {
 	GtkTreeView *view = GTK_TREE_VIEW(widget);
 	GtkTreePath *path;
-	GtkTreeViewColumn *column;
 	GtkTreeIter iter;
 	struct menu *menu;
-
 	gint tx = (gint) event->x;
 	gint ty = (gint) event->y;
-	gint cx, cy;
 
-	gtk_tree_view_get_path_at_pos(view, tx, ty, &path, &column, &cx,
-				      &cy);
+	gtk_tree_view_get_path_at_pos(view, tx, ty, &path, NULL, NULL, NULL);
 	if (path == NULL)
 		return FALSE;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 22/66] kconfig: gconf: remove unused 'color' variable
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (20 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 21/66] kconfig: gconf: remove unneeded variables in on_treeview*_button_press_event() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 23/66] kconfig: gconf: add static qualifiers to variables Masahiro Yamada
                   ` (44 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This is not used at all.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index ab2e0df21037..4fff931f34fc 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -43,7 +43,6 @@ GtkWidget *save_btn = NULL;
 GtkWidget *save_menu_item = NULL;
 
 GtkTextTag *tag1, *tag2;
-GdkColor color;
 
 GtkTreeStore *tree1, *tree2, *tree;
 GtkTreeModel *model1, *model2;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 23/66] kconfig: gconf: add static qualifiers to variables
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (21 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 22/66] kconfig: gconf: remove unused 'color' variable Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 24/66] kconfig: gconf: move init_*() functions below Masahiro Yamada
                   ` (43 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

I also removed unnecessary initializers.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 4fff931f34fc..0d5a02706bcb 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -32,20 +32,20 @@ static gboolean show_range = TRUE;
 static gboolean show_value = TRUE;
 static int opt_mode = OPT_NORMAL;
 
-GtkWidget *main_wnd = NULL;
-GtkWidget *tree1_w = NULL;	// left  frame
-GtkWidget *tree2_w = NULL;	// right frame
-GtkWidget *text_w = NULL;
-GtkWidget *hpaned = NULL;
-GtkWidget *vpaned = NULL;
-GtkWidget *back_btn = NULL;
-GtkWidget *save_btn = NULL;
-GtkWidget *save_menu_item = NULL;
+static GtkWidget *main_wnd;
+static GtkWidget *tree1_w;	// left  frame
+static GtkWidget *tree2_w;	// right frame
+static GtkWidget *text_w;
+static GtkWidget *hpaned;
+static GtkWidget *vpaned;
+static GtkWidget *back_btn;
+static GtkWidget *save_btn;
+static GtkWidget *save_menu_item;
 
-GtkTextTag *tag1, *tag2;
+static GtkTextTag *tag1, *tag2;
 
-GtkTreeStore *tree1, *tree2, *tree;
-GtkTreeModel *model1, *model2;
+static GtkTreeStore *tree1, *tree2, *tree;
+static GtkTreeModel *model1, *model2;
 
 static struct menu *current; // current node for SINGLE view
 static struct menu *browsed; // browsed node for SPLIT view
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 24/66] kconfig: gconf: move init_*() functions below
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (22 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 23/66] kconfig: gconf: add static qualifiers to variables Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 25/66] kconfig: gconf: refactor view setting code Masahiro Yamada
                   ` (42 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This allows removal of the forward declaration of renderer_edited().

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 450 ++++++++++++++++++++--------------------
 1 file changed, 222 insertions(+), 228 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 0d5a02706bcb..9d06c050b270 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -62,240 +62,12 @@ static void display_tree(struct menu *menu);
 static void display_tree_part(void);
 static void update_tree(struct menu *src, GtkTreeIter * dst);
 
-static void replace_button_icon(GladeXML *xml, GdkDrawable *window,
-				GtkStyle *style, gchar *btn_name, gchar **xpm)
-{
-	GdkPixmap *pixmap;
-	GdkBitmap *mask;
-	GtkToolButton *button;
-	GtkWidget *image;
-
-	pixmap = gdk_pixmap_create_from_xpm_d(window, &mask,
-					      &style->bg[GTK_STATE_NORMAL],
-					      xpm);
-
-	button = GTK_TOOL_BUTTON(glade_xml_get_widget(xml, btn_name));
-	image = gtk_image_new_from_pixmap(pixmap, mask);
-	gtk_widget_show(image);
-	gtk_tool_button_set_icon_widget(button, image);
-}
-
 static void conf_changed(bool dirty)
 {
 	gtk_widget_set_sensitive(save_btn, dirty);
 	gtk_widget_set_sensitive(save_menu_item, dirty);
 }
 
-/* Main Window Initialization */
-static void init_main_window(const gchar *glade_file)
-{
-	GladeXML *xml;
-	GtkWidget *widget;
-	GtkTextBuffer *txtbuf;
-	GtkStyle *style;
-
-	xml = glade_xml_new(glade_file, "window1", NULL);
-	if (!xml)
-		g_error("GUI loading failed !\n");
-	glade_xml_signal_autoconnect(xml);
-
-	main_wnd = glade_xml_get_widget(xml, "window1");
-	hpaned = glade_xml_get_widget(xml, "hpaned1");
-	vpaned = glade_xml_get_widget(xml, "vpaned1");
-	tree1_w = glade_xml_get_widget(xml, "treeview1");
-	tree2_w = glade_xml_get_widget(xml, "treeview2");
-	text_w = glade_xml_get_widget(xml, "textview3");
-
-	back_btn = glade_xml_get_widget(xml, "button1");
-	gtk_widget_set_sensitive(back_btn, FALSE);
-
-	widget = glade_xml_get_widget(xml, "show_name1");
-	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
-				       show_name);
-
-	widget = glade_xml_get_widget(xml, "show_range1");
-	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
-				       show_range);
-
-	widget = glade_xml_get_widget(xml, "show_data1");
-	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
-				       show_value);
-
-	save_btn = glade_xml_get_widget(xml, "button3");
-	save_menu_item = glade_xml_get_widget(xml, "save1");
-	conf_set_changed_callback(conf_changed);
-
-	style = gtk_widget_get_style(main_wnd);
-
-	replace_button_icon(xml, main_wnd->window, style,
-			    "button4", (gchar **) xpm_single_view);
-	replace_button_icon(xml, main_wnd->window, style,
-			    "button5", (gchar **) xpm_split_view);
-	replace_button_icon(xml, main_wnd->window, style,
-			    "button6", (gchar **) xpm_tree_view);
-
-	txtbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w));
-	tag1 = gtk_text_buffer_create_tag(txtbuf, "mytag1",
-					  "foreground", "red",
-					  "weight", PANGO_WEIGHT_BOLD,
-					  NULL);
-	tag2 = gtk_text_buffer_create_tag(txtbuf, "mytag2",
-					  /*"style", PANGO_STYLE_OBLIQUE, */
-					  NULL);
-
-	gtk_window_set_title(GTK_WINDOW(main_wnd), rootmenu.prompt->text);
-
-	gtk_widget_show(main_wnd);
-}
-
-static void init_tree_model(void)
-{
-	tree = tree2 = gtk_tree_store_new(COL_NUMBER,
-					  G_TYPE_STRING, G_TYPE_STRING,
-					  G_TYPE_STRING, G_TYPE_STRING,
-					  G_TYPE_STRING, G_TYPE_STRING,
-					  G_TYPE_POINTER, GDK_TYPE_COLOR,
-					  G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF,
-					  G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
-					  G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
-					  G_TYPE_BOOLEAN);
-	model2 = GTK_TREE_MODEL(tree2);
-
-	tree1 = gtk_tree_store_new(COL_NUMBER,
-				   G_TYPE_STRING, G_TYPE_STRING,
-				   G_TYPE_STRING, G_TYPE_STRING,
-				   G_TYPE_STRING, G_TYPE_STRING,
-				   G_TYPE_POINTER, GDK_TYPE_COLOR,
-				   G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF,
-				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
-				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
-				   G_TYPE_BOOLEAN);
-	model1 = GTK_TREE_MODEL(tree1);
-}
-
-static void init_left_tree(void)
-{
-	GtkTreeView *view = GTK_TREE_VIEW(tree1_w);
-	GtkCellRenderer *renderer;
-	GtkTreeSelection *sel;
-	GtkTreeViewColumn *column;
-
-	gtk_tree_view_set_model(view, model1);
-
-	column = gtk_tree_view_column_new();
-	gtk_tree_view_append_column(view, column);
-	gtk_tree_view_column_set_title(column, "Options");
-
-	renderer = gtk_cell_renderer_toggle_new();
-	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
-					renderer, FALSE);
-	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
-					    renderer,
-					    "active", COL_BTNACT,
-					    "inconsistent", COL_BTNINC,
-					    "visible", COL_BTNVIS,
-					    "radio", COL_BTNRAD, NULL);
-	renderer = gtk_cell_renderer_text_new();
-	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
-					renderer, FALSE);
-	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
-					    renderer,
-					    "text", COL_OPTION,
-					    "foreground-gdk",
-					    COL_COLOR, NULL);
-
-	sel = gtk_tree_view_get_selection(view);
-	gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE);
-}
-
-static void renderer_edited(GtkCellRendererText * cell,
-			    const gchar * path_string,
-			    const gchar * new_text, gpointer user_data);
-
-static void init_right_tree(void)
-{
-	GtkTreeView *view = GTK_TREE_VIEW(tree2_w);
-	GtkCellRenderer *renderer;
-	GtkTreeSelection *sel;
-	GtkTreeViewColumn *column;
-	gint i;
-
-	gtk_tree_view_set_model(view, model2);
-
-	column = gtk_tree_view_column_new();
-	gtk_tree_view_append_column(view, column);
-	gtk_tree_view_column_set_title(column, "Options");
-
-	renderer = gtk_cell_renderer_pixbuf_new();
-	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
-					renderer, FALSE);
-	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
-					    renderer,
-					    "pixbuf", COL_PIXBUF,
-					    "visible", COL_PIXVIS, NULL);
-	renderer = gtk_cell_renderer_toggle_new();
-	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
-					renderer, FALSE);
-	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
-					    renderer,
-					    "active", COL_BTNACT,
-					    "inconsistent", COL_BTNINC,
-					    "visible", COL_BTNVIS,
-					    "radio", COL_BTNRAD, NULL);
-	renderer = gtk_cell_renderer_text_new();
-	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
-					renderer, FALSE);
-	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
-					    renderer,
-					    "text", COL_OPTION,
-					    "foreground-gdk",
-					    COL_COLOR, NULL);
-
-	renderer = gtk_cell_renderer_text_new();
-	gtk_tree_view_insert_column_with_attributes(view, -1,
-						    "Name", renderer,
-						    "text", COL_NAME,
-						    "foreground-gdk",
-						    COL_COLOR, NULL);
-	renderer = gtk_cell_renderer_text_new();
-	gtk_tree_view_insert_column_with_attributes(view, -1,
-						    "N", renderer,
-						    "text", COL_NO,
-						    "foreground-gdk",
-						    COL_COLOR, NULL);
-	renderer = gtk_cell_renderer_text_new();
-	gtk_tree_view_insert_column_with_attributes(view, -1,
-						    "M", renderer,
-						    "text", COL_MOD,
-						    "foreground-gdk",
-						    COL_COLOR, NULL);
-	renderer = gtk_cell_renderer_text_new();
-	gtk_tree_view_insert_column_with_attributes(view, -1,
-						    "Y", renderer,
-						    "text", COL_YES,
-						    "foreground-gdk",
-						    COL_COLOR, NULL);
-	renderer = gtk_cell_renderer_text_new();
-	gtk_tree_view_insert_column_with_attributes(view, -1,
-						    "Value", renderer,
-						    "text", COL_VALUE,
-						    "editable",
-						    COL_EDIT,
-						    "foreground-gdk",
-						    COL_COLOR, NULL);
-	g_signal_connect(G_OBJECT(renderer), "edited",
-			 G_CALLBACK(renderer_edited), NULL);
-
-	for (i = 0; i < COL_VALUE; i++) {
-		column = gtk_tree_view_get_column(view, i);
-		gtk_tree_view_column_set_resizable(column, TRUE);
-	}
-
-	sel = gtk_tree_view_get_selection(view);
-	gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE);
-}
-
-
 /* Utility Functions */
 
 
@@ -1324,6 +1096,228 @@ static void fixup_rootmenu(struct menu *menu)
 	}
 }
 
+/* Main Window Initialization */
+static void replace_button_icon(GladeXML *xml, GdkDrawable *window,
+				GtkStyle *style, gchar *btn_name, gchar **xpm)
+{
+	GdkPixmap *pixmap;
+	GdkBitmap *mask;
+	GtkToolButton *button;
+	GtkWidget *image;
+
+	pixmap = gdk_pixmap_create_from_xpm_d(window, &mask,
+					      &style->bg[GTK_STATE_NORMAL],
+					      xpm);
+
+	button = GTK_TOOL_BUTTON(glade_xml_get_widget(xml, btn_name));
+	image = gtk_image_new_from_pixmap(pixmap, mask);
+	gtk_widget_show(image);
+	gtk_tool_button_set_icon_widget(button, image);
+}
+
+static void init_main_window(const gchar *glade_file)
+{
+	GladeXML *xml;
+	GtkWidget *widget;
+	GtkTextBuffer *txtbuf;
+	GtkStyle *style;
+
+	xml = glade_xml_new(glade_file, "window1", NULL);
+	if (!xml)
+		g_error("GUI loading failed !\n");
+	glade_xml_signal_autoconnect(xml);
+
+	main_wnd = glade_xml_get_widget(xml, "window1");
+	hpaned = glade_xml_get_widget(xml, "hpaned1");
+	vpaned = glade_xml_get_widget(xml, "vpaned1");
+	tree1_w = glade_xml_get_widget(xml, "treeview1");
+	tree2_w = glade_xml_get_widget(xml, "treeview2");
+	text_w = glade_xml_get_widget(xml, "textview3");
+
+	back_btn = glade_xml_get_widget(xml, "button1");
+	gtk_widget_set_sensitive(back_btn, FALSE);
+
+	widget = glade_xml_get_widget(xml, "show_name1");
+	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
+				       show_name);
+
+	widget = glade_xml_get_widget(xml, "show_range1");
+	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
+				       show_range);
+
+	widget = glade_xml_get_widget(xml, "show_data1");
+	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
+				       show_value);
+
+	save_btn = glade_xml_get_widget(xml, "button3");
+	save_menu_item = glade_xml_get_widget(xml, "save1");
+	conf_set_changed_callback(conf_changed);
+
+	style = gtk_widget_get_style(main_wnd);
+
+	replace_button_icon(xml, main_wnd->window, style,
+			    "button4", (gchar **) xpm_single_view);
+	replace_button_icon(xml, main_wnd->window, style,
+			    "button5", (gchar **) xpm_split_view);
+	replace_button_icon(xml, main_wnd->window, style,
+			    "button6", (gchar **) xpm_tree_view);
+
+	txtbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w));
+	tag1 = gtk_text_buffer_create_tag(txtbuf, "mytag1",
+					  "foreground", "red",
+					  "weight", PANGO_WEIGHT_BOLD,
+					  NULL);
+	tag2 = gtk_text_buffer_create_tag(txtbuf, "mytag2",
+					  /*"style", PANGO_STYLE_OBLIQUE, */
+					  NULL);
+
+	gtk_window_set_title(GTK_WINDOW(main_wnd), rootmenu.prompt->text);
+
+	gtk_widget_show(main_wnd);
+}
+
+static void init_tree_model(void)
+{
+	tree = tree2 = gtk_tree_store_new(COL_NUMBER,
+					  G_TYPE_STRING, G_TYPE_STRING,
+					  G_TYPE_STRING, G_TYPE_STRING,
+					  G_TYPE_STRING, G_TYPE_STRING,
+					  G_TYPE_POINTER, GDK_TYPE_COLOR,
+					  G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF,
+					  G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
+					  G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
+					  G_TYPE_BOOLEAN);
+	model2 = GTK_TREE_MODEL(tree2);
+
+	tree1 = gtk_tree_store_new(COL_NUMBER,
+				   G_TYPE_STRING, G_TYPE_STRING,
+				   G_TYPE_STRING, G_TYPE_STRING,
+				   G_TYPE_STRING, G_TYPE_STRING,
+				   G_TYPE_POINTER, GDK_TYPE_COLOR,
+				   G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF,
+				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
+				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
+				   G_TYPE_BOOLEAN);
+	model1 = GTK_TREE_MODEL(tree1);
+}
+
+static void init_left_tree(void)
+{
+	GtkTreeView *view = GTK_TREE_VIEW(tree1_w);
+	GtkCellRenderer *renderer;
+	GtkTreeSelection *sel;
+	GtkTreeViewColumn *column;
+
+	gtk_tree_view_set_model(view, model1);
+
+	column = gtk_tree_view_column_new();
+	gtk_tree_view_append_column(view, column);
+	gtk_tree_view_column_set_title(column, "Options");
+
+	renderer = gtk_cell_renderer_toggle_new();
+	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
+					renderer, FALSE);
+	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
+					    renderer,
+					    "active", COL_BTNACT,
+					    "inconsistent", COL_BTNINC,
+					    "visible", COL_BTNVIS,
+					    "radio", COL_BTNRAD, NULL);
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
+					renderer, FALSE);
+	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
+					    renderer,
+					    "text", COL_OPTION,
+					    "foreground-gdk",
+					    COL_COLOR, NULL);
+
+	sel = gtk_tree_view_get_selection(view);
+	gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE);
+}
+
+static void init_right_tree(void)
+{
+	GtkTreeView *view = GTK_TREE_VIEW(tree2_w);
+	GtkCellRenderer *renderer;
+	GtkTreeSelection *sel;
+	GtkTreeViewColumn *column;
+	gint i;
+
+	gtk_tree_view_set_model(view, model2);
+
+	column = gtk_tree_view_column_new();
+	gtk_tree_view_append_column(view, column);
+	gtk_tree_view_column_set_title(column, "Options");
+
+	renderer = gtk_cell_renderer_pixbuf_new();
+	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
+					renderer, FALSE);
+	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
+					    renderer,
+					    "pixbuf", COL_PIXBUF,
+					    "visible", COL_PIXVIS, NULL);
+	renderer = gtk_cell_renderer_toggle_new();
+	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
+					renderer, FALSE);
+	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
+					    renderer,
+					    "active", COL_BTNACT,
+					    "inconsistent", COL_BTNINC,
+					    "visible", COL_BTNVIS,
+					    "radio", COL_BTNRAD, NULL);
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
+					renderer, FALSE);
+	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
+					    renderer,
+					    "text", COL_OPTION,
+					    "foreground-gdk",
+					    COL_COLOR, NULL);
+
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_insert_column_with_attributes(view, -1,
+						    "Name", renderer,
+						    "text", COL_NAME,
+						    "foreground-gdk",
+						    COL_COLOR, NULL);
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_insert_column_with_attributes(view, -1,
+						    "N", renderer,
+						    "text", COL_NO,
+						    "foreground-gdk",
+						    COL_COLOR, NULL);
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_insert_column_with_attributes(view, -1,
+						    "M", renderer,
+						    "text", COL_MOD,
+						    "foreground-gdk",
+						    COL_COLOR, NULL);
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_insert_column_with_attributes(view, -1,
+						    "Y", renderer,
+						    "text", COL_YES,
+						    "foreground-gdk",
+						    COL_COLOR, NULL);
+	renderer = gtk_cell_renderer_text_new();
+	gtk_tree_view_insert_column_with_attributes(view, -1,
+						    "Value", renderer,
+						    "text", COL_VALUE,
+						    "editable",
+						    COL_EDIT,
+						    "foreground-gdk",
+						    COL_COLOR, NULL);
+	g_signal_connect(G_OBJECT(renderer), "edited",
+			 G_CALLBACK(renderer_edited), NULL);
+
+	for (i = 0; i < COL_VALUE; i++) {
+		column = gtk_tree_view_get_column(view, i);
+		gtk_tree_view_column_set_resizable(column, TRUE);
+	}
+
+	sel = gtk_tree_view_get_selection(view);
+	gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE);
+}
 
 /* Main */
 int main(int ac, char *av[])
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 25/66] kconfig: gconf: refactor view setting code
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (23 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 24/66] kconfig: gconf: move init_*() functions below Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-30  2:51   ` Randy Dunlap
  2025-06-24 15:05 ` [PATCH 26/66] kconfig: gconf: grey out button for current view Masahiro Yamada
                   ` (41 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

Factor out common code for setting the view into a new function,
set_view_mode().

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 74 +++++++++++++++++++++--------------------
 1 file changed, 38 insertions(+), 36 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 9d06c050b270..b67ebff3f288 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -18,7 +18,7 @@
 #include <unistd.h>
 #include <time.h>
 
-enum {
+enum view_mode {
 	SINGLE_VIEW, SPLIT_VIEW, FULL_VIEW
 };
 
@@ -70,6 +70,39 @@ static void conf_changed(bool dirty)
 
 /* Utility Functions */
 
+static void set_view_mode(enum view_mode mode)
+{
+	view_mode = mode;
+
+	if (mode == SPLIT_VIEW) { // two panes
+		gint w;
+
+		gtk_widget_show(tree1_w);
+		gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, NULL);
+		gtk_paned_set_position(GTK_PANED(hpaned), w / 2);
+	} else {
+		gtk_widget_hide(tree1_w);
+		gtk_paned_set_position(GTK_PANED(hpaned), 0);
+	}
+
+	switch (mode) {
+	case SINGLE_VIEW:
+		current = &rootmenu;
+		display_tree_part();
+		break;
+	case SPLIT_VIEW:
+		gtk_tree_store_clear(tree2);
+		display_list();
+		break;
+	case FULL_VIEW:
+		gtk_tree_store_clear(tree2);
+		display_tree(&rootmenu);
+		break;
+	}
+
+	if (mode != SINGLE_VIEW)
+		gtk_widget_set_sensitive(back_btn, FALSE);
+}
 
 static void text_insert_help(struct menu *menu)
 {
@@ -435,35 +468,19 @@ void on_load_clicked(GtkButton * button, gpointer user_data)
 
 void on_single_clicked(GtkButton * button, gpointer user_data)
 {
-	view_mode = SINGLE_VIEW;
-	gtk_widget_hide(tree1_w);
-	current = &rootmenu;
-	display_tree_part();
+	set_view_mode(SINGLE_VIEW);
 }
 
 
 void on_split_clicked(GtkButton * button, gpointer user_data)
 {
-	gint w;
-	view_mode = SPLIT_VIEW;
-	gtk_widget_show(tree1_w);
-	gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, NULL);
-	gtk_paned_set_position(GTK_PANED(hpaned), w / 2);
-	gtk_tree_store_clear(tree2);
-	display_list();
-
-	/* Disable back btn, like in full mode. */
-	gtk_widget_set_sensitive(back_btn, FALSE);
+	set_view_mode(SPLIT_VIEW);
 }
 
 
 void on_full_clicked(GtkButton * button, gpointer user_data)
 {
-	view_mode = FULL_VIEW;
-	gtk_widget_hide(tree1_w);
-	gtk_tree_store_clear(tree2);
-	display_tree(&rootmenu);
-	gtk_widget_set_sensitive(back_btn, FALSE);
+	set_view_mode(FULL_VIEW);
 }
 
 
@@ -1039,11 +1056,6 @@ static void _display_tree(struct menu *menu, GtkTreeIter *parent)
 		    || (view_mode == FULL_VIEW)
 		    || (view_mode == SPLIT_VIEW))*/
 
-		/* Change paned position if the view is not in 'split mode' */
-		if (view_mode == SINGLE_VIEW || view_mode == FULL_VIEW) {
-			gtk_paned_set_position(GTK_PANED(hpaned), 0);
-		}
-
 		if (((view_mode == SINGLE_VIEW) && (menu->flags & MENU_ROOT))
 		    || (view_mode == FULL_VIEW)
 		    || (view_mode == SPLIT_VIEW))
@@ -1368,17 +1380,7 @@ int main(int ac, char *av[])
 
 	conf_read(NULL);
 
-	switch (view_mode) {
-	case SINGLE_VIEW:
-		display_tree_part();
-		break;
-	case SPLIT_VIEW:
-		display_list();
-		break;
-	case FULL_VIEW:
-		display_tree(&rootmenu);
-		break;
-	}
+	set_view_mode(view_mode);
 
 	gtk_main();
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 26/66] kconfig: gconf: grey out button for current view
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (24 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 25/66] kconfig: gconf: refactor view setting code Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-30  2:53   ` Randy Dunlap
  2025-06-24 15:05 ` [PATCH 27/66] kconfig: gconf: move the main window event handlers below Masahiro Yamada
                   ` (40 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This clarifies which view is currently selected.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index b67ebff3f288..67c5c965aaf8 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -38,8 +38,7 @@ static GtkWidget *tree2_w;	// right frame
 static GtkWidget *text_w;
 static GtkWidget *hpaned;
 static GtkWidget *vpaned;
-static GtkWidget *back_btn;
-static GtkWidget *save_btn;
+static GtkWidget *back_btn, *save_btn, *single_btn, *split_btn, *full_btn;
 static GtkWidget *save_menu_item;
 
 static GtkTextTag *tag1, *tag2;
@@ -85,18 +84,25 @@ static void set_view_mode(enum view_mode mode)
 		gtk_paned_set_position(GTK_PANED(hpaned), 0);
 	}
 
+	gtk_widget_set_sensitive(single_btn, TRUE);
+	gtk_widget_set_sensitive(split_btn, TRUE);
+	gtk_widget_set_sensitive(full_btn, TRUE);
+
 	switch (mode) {
 	case SINGLE_VIEW:
 		current = &rootmenu;
 		display_tree_part();
+		gtk_widget_set_sensitive(single_btn, FALSE);
 		break;
 	case SPLIT_VIEW:
 		gtk_tree_store_clear(tree2);
 		display_list();
+		gtk_widget_set_sensitive(split_btn, FALSE);
 		break;
 	case FULL_VIEW:
 		gtk_tree_store_clear(tree2);
 		display_tree(&rootmenu);
+		gtk_widget_set_sensitive(full_btn, FALSE);
 		break;
 	}
 
@@ -1167,10 +1173,15 @@ static void init_main_window(const gchar *glade_file)
 
 	style = gtk_widget_get_style(main_wnd);
 
+	single_btn = glade_xml_get_widget(xml, "button4");
 	replace_button_icon(xml, main_wnd->window, style,
 			    "button4", (gchar **) xpm_single_view);
+
+	split_btn = glade_xml_get_widget(xml, "button5");
 	replace_button_icon(xml, main_wnd->window, style,
 			    "button5", (gchar **) xpm_split_view);
+
+	full_btn = glade_xml_get_widget(xml, "button6");
 	replace_button_icon(xml, main_wnd->window, style,
 			    "button6", (gchar **) xpm_tree_view);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 27/66] kconfig: gconf: move the main window event handlers below
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (25 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 26/66] kconfig: gconf: grey out button for current view Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 28/66] kconfig: gconf: move button1 initialization below Masahiro Yamada
                   ` (39 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This allows removal of the forward delcaration of on_save_activate().

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 164 +++++++++++++++++++---------------------
 1 file changed, 78 insertions(+), 86 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 67c5c965aaf8..530ad6aa42d0 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -155,84 +155,6 @@ static void text_insert_msg(const char *title, const char *message)
 					 NULL);
 }
 
-
-/* Main Windows Callbacks */
-
-void on_save_activate(GtkMenuItem * menuitem, gpointer user_data);
-gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event,
-				 gpointer user_data)
-{
-	GtkWidget *dialog, *label;
-	gint result;
-	gint ret = FALSE;
-
-	if (!conf_get_changed())
-		return FALSE;
-
-	dialog = gtk_dialog_new_with_buttons("Warning !",
-					     GTK_WINDOW(main_wnd),
-					     (GtkDialogFlags)
-					     (GTK_DIALOG_MODAL |
-					      GTK_DIALOG_DESTROY_WITH_PARENT),
-					     GTK_STOCK_OK,
-					     GTK_RESPONSE_YES,
-					     GTK_STOCK_NO,
-					     GTK_RESPONSE_NO,
-					     GTK_STOCK_CANCEL,
-					     GTK_RESPONSE_CANCEL, NULL);
-	gtk_dialog_set_default_response(GTK_DIALOG(dialog),
-					GTK_RESPONSE_CANCEL);
-
-	label = gtk_label_new("\nSave configuration ?\n");
-	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
-	gtk_widget_show(label);
-
-	result = gtk_dialog_run(GTK_DIALOG(dialog));
-	switch (result) {
-	case GTK_RESPONSE_YES:
-		on_save_activate(NULL, NULL);
-		break;
-	case GTK_RESPONSE_NO:
-		break;
-	case GTK_RESPONSE_CANCEL:
-	case GTK_RESPONSE_DELETE_EVENT:
-	default:
-		ret = TRUE;
-		break;
-	}
-
-	gtk_widget_destroy(dialog);
-
-	return ret;
-}
-
-
-void on_window1_destroy(GtkObject * object, gpointer user_data)
-{
-	gtk_main_quit();
-}
-
-
-void
-on_window1_size_request(GtkWidget * widget,
-			GtkRequisition * requisition, 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);
-}
-
-
 /* Menu & Toolbar Callbacks */
 
 
@@ -311,14 +233,6 @@ void on_save_as1_activate(GtkMenuItem * menuitem, gpointer user_data)
 	gtk_widget_show(fs);
 }
 
-
-void on_quit1_activate(GtkMenuItem * menuitem, gpointer user_data)
-{
-	if (!on_window1_delete_event(NULL, NULL, NULL))
-		gtk_widget_destroy(GTK_WIDGET(main_wnd));
-}
-
-
 void on_show_name1_activate(GtkMenuItem * menuitem, gpointer user_data)
 {
 	GtkTreeViewColumn *col;
@@ -501,6 +415,84 @@ void on_expand_clicked(GtkButton * button, gpointer user_data)
 	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w));
 }
 
+/* Main Windows Callbacks */
+
+void on_window1_destroy(GtkObject *object, gpointer user_data)
+{
+	gtk_main_quit();
+}
+
+void on_window1_size_request(GtkWidget *widget,
+				    GtkRequisition *requisition,
+				    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);
+}
+
+gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
+					gpointer user_data)
+{
+	GtkWidget *dialog, *label;
+	gint result;
+	gint ret = FALSE;
+
+	if (!conf_get_changed())
+		return FALSE;
+
+	dialog = gtk_dialog_new_with_buttons("Warning !",
+					     GTK_WINDOW(main_wnd),
+					     (GtkDialogFlags)
+					     (GTK_DIALOG_MODAL |
+					      GTK_DIALOG_DESTROY_WITH_PARENT),
+					     GTK_STOCK_OK,
+					     GTK_RESPONSE_YES,
+					     GTK_STOCK_NO,
+					     GTK_RESPONSE_NO,
+					     GTK_STOCK_CANCEL,
+					     GTK_RESPONSE_CANCEL, NULL);
+	gtk_dialog_set_default_response(GTK_DIALOG(dialog),
+					GTK_RESPONSE_CANCEL);
+
+	label = gtk_label_new("\nSave configuration ?\n");
+	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
+	gtk_widget_show(label);
+
+	result = gtk_dialog_run(GTK_DIALOG(dialog));
+	switch (result) {
+	case GTK_RESPONSE_YES:
+		on_save_activate(NULL, NULL);
+		break;
+	case GTK_RESPONSE_NO:
+		break;
+	case GTK_RESPONSE_CANCEL:
+	case GTK_RESPONSE_DELETE_EVENT:
+	default:
+		ret = TRUE;
+		break;
+	}
+
+	gtk_widget_destroy(dialog);
+
+	return ret;
+}
+
+void on_quit1_activate(GtkMenuItem *menuitem, gpointer user_data)
+{
+	if (!on_window1_delete_event(NULL, NULL, NULL))
+		gtk_widget_destroy(GTK_WIDGET(main_wnd));
+}
 
 /* CTree Callbacks */
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 28/66] kconfig: gconf: move button1 initialization below
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (26 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 27/66] kconfig: gconf: move the main window event handlers below Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 29/66] kconfig: gconf: add static qualifiers to event handlers Masahiro Yamada
                   ` (38 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

Collect the toolbar-related code in one place.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 530ad6aa42d0..bed4c86c2085 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -1144,9 +1144,7 @@ static void init_main_window(const gchar *glade_file)
 	tree2_w = glade_xml_get_widget(xml, "treeview2");
 	text_w = glade_xml_get_widget(xml, "textview3");
 
-	back_btn = glade_xml_get_widget(xml, "button1");
-	gtk_widget_set_sensitive(back_btn, FALSE);
-
+	/* menubar */
 	widget = glade_xml_get_widget(xml, "show_name1");
 	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
 				       show_name);
@@ -1159,6 +1157,10 @@ static void init_main_window(const gchar *glade_file)
 	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
 				       show_value);
 
+	/* toolbar */
+	back_btn = glade_xml_get_widget(xml, "button1");
+	gtk_widget_set_sensitive(back_btn, FALSE);
+
 	save_btn = glade_xml_get_widget(xml, "button3");
 	save_menu_item = glade_xml_get_widget(xml, "save1");
 	conf_set_changed_callback(conf_changed);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 29/66] kconfig: gconf: add static qualifiers to event handlers
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (27 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 28/66] kconfig: gconf: move button1 initialization below Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-30  2:55   ` Randy Dunlap
  2025-06-24 15:05 ` [PATCH 30/66] kconfig: gconf: remove glade_xml_signal_autoconnect() call Masahiro Yamada
                   ` (37 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This fixes several -Wmissing-prototypes warnings.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c     | 173 +++++++++++++++++++++++++-----------
 scripts/kconfig/gconf.glade |  30 -------
 2 files changed, 120 insertions(+), 83 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index bed4c86c2085..02bbb7ce4c4a 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -172,7 +172,7 @@ load_filename(GtkFileSelection * file_selector, gpointer user_data)
 		display_tree_part();
 }
 
-void on_load1_activate(GtkMenuItem * menuitem, gpointer user_data)
+static void on_load1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
 	GtkWidget *fs;
 
@@ -191,8 +191,7 @@ void on_load1_activate(GtkMenuItem * menuitem, gpointer user_data)
 	gtk_widget_show(fs);
 }
 
-
-void on_save_activate(GtkMenuItem * menuitem, gpointer user_data)
+static void on_save_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
 	if (conf_write(NULL))
 		text_insert_msg("Error", "Unable to save configuration !");
@@ -214,7 +213,7 @@ store_filename(GtkFileSelection * file_selector, gpointer user_data)
 	gtk_widget_destroy(GTK_WIDGET(user_data));
 }
 
-void on_save_as1_activate(GtkMenuItem * menuitem, gpointer user_data)
+static void on_save_as1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
 	GtkWidget *fs;
 
@@ -233,7 +232,7 @@ void on_save_as1_activate(GtkMenuItem * menuitem, gpointer user_data)
 	gtk_widget_show(fs);
 }
 
-void on_show_name1_activate(GtkMenuItem * menuitem, gpointer user_data)
+static void on_show_name1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
 	GtkTreeViewColumn *col;
 
@@ -243,8 +242,7 @@ void on_show_name1_activate(GtkMenuItem * menuitem, gpointer user_data)
 		gtk_tree_view_column_set_visible(col, show_name);
 }
 
-
-void on_show_range1_activate(GtkMenuItem * menuitem, gpointer user_data)
+static void on_show_range1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
 	GtkTreeViewColumn *col;
 
@@ -261,8 +259,7 @@ void on_show_range1_activate(GtkMenuItem * menuitem, gpointer user_data)
 
 }
 
-
-void on_show_data1_activate(GtkMenuItem * menuitem, gpointer user_data)
+static void on_show_data1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
 	GtkTreeViewColumn *col;
 
@@ -272,35 +269,31 @@ void on_show_data1_activate(GtkMenuItem * menuitem, gpointer user_data)
 		gtk_tree_view_column_set_visible(col, show_value);
 }
 
-
-void
-on_set_option_mode1_activate(GtkMenuItem *menuitem, gpointer user_data)
+static void on_set_option_mode1_activate(GtkMenuItem *menuitem,
+					 gpointer user_data)
 {
 	opt_mode = OPT_NORMAL;
 	gtk_tree_store_clear(tree2);
 	display_tree(&rootmenu);	/* instead of update_tree to speed-up */
 }
 
-
-void
-on_set_option_mode2_activate(GtkMenuItem *menuitem, gpointer user_data)
+static void on_set_option_mode2_activate(GtkMenuItem *menuitem,
+					 gpointer user_data)
 {
 	opt_mode = OPT_ALL;
 	gtk_tree_store_clear(tree2);
 	display_tree(&rootmenu);	/* instead of update_tree to speed-up */
 }
 
-
-void
-on_set_option_mode3_activate(GtkMenuItem *menuitem, gpointer user_data)
+static void on_set_option_mode3_activate(GtkMenuItem *menuitem,
+					 gpointer user_data)
 {
 	opt_mode = OPT_PROMPT;
 	gtk_tree_store_clear(tree2);
 	display_tree(&rootmenu);	/* instead of update_tree to speed-up */
 }
 
-
-void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data)
+static void on_introduction1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
 	GtkWidget *dialog;
 	const gchar *intro_text =
@@ -327,8 +320,7 @@ void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data)
 	gtk_widget_show_all(dialog);
 }
 
-
-void on_about1_activate(GtkMenuItem * menuitem, gpointer user_data)
+static void on_about1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
 	GtkWidget *dialog;
 	const gchar *about_text =
@@ -345,8 +337,7 @@ void on_about1_activate(GtkMenuItem * menuitem, gpointer user_data)
 	gtk_widget_show_all(dialog);
 }
 
-
-void on_license1_activate(GtkMenuItem * menuitem, gpointer user_data)
+static void on_license1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
 	GtkWidget *dialog;
 	const gchar *license_text =
@@ -364,8 +355,8 @@ void on_license1_activate(GtkMenuItem * menuitem, gpointer user_data)
 	gtk_widget_show_all(dialog);
 }
 
-
-void on_back_clicked(GtkButton * button, gpointer user_data)
+/* toolbar handlers */
+static void on_back_clicked(GtkButton *button, gpointer user_data)
 {
 	enum prop_type ptype;
 
@@ -379,50 +370,44 @@ void on_back_clicked(GtkButton * button, gpointer user_data)
 		gtk_widget_set_sensitive(back_btn, FALSE);
 }
 
-
-void on_load_clicked(GtkButton * button, gpointer user_data)
+static void on_load_clicked(GtkButton *button, gpointer user_data)
 {
 	on_load1_activate(NULL, user_data);
 }
 
-
-void on_single_clicked(GtkButton * button, gpointer user_data)
+static void on_single_clicked(GtkButton *button, gpointer user_data)
 {
 	set_view_mode(SINGLE_VIEW);
 }
 
-
-void on_split_clicked(GtkButton * button, gpointer user_data)
+static void on_split_clicked(GtkButton *button, gpointer user_data)
 {
 	set_view_mode(SPLIT_VIEW);
 }
 
-
-void on_full_clicked(GtkButton * button, gpointer user_data)
+static void on_full_clicked(GtkButton *button, gpointer user_data)
 {
 	set_view_mode(FULL_VIEW);
 }
 
-
-void on_collapse_clicked(GtkButton * button, gpointer user_data)
+static void on_collapse_clicked(GtkButton *button, gpointer user_data)
 {
 	gtk_tree_view_collapse_all(GTK_TREE_VIEW(tree2_w));
 }
 
-
-void on_expand_clicked(GtkButton * button, gpointer user_data)
+static void on_expand_clicked(GtkButton *button, gpointer user_data)
 {
 	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w));
 }
 
 /* Main Windows Callbacks */
 
-void on_window1_destroy(GtkObject *object, gpointer user_data)
+static void on_window1_destroy(GtkObject *object, gpointer user_data)
 {
 	gtk_main_quit();
 }
 
-void on_window1_size_request(GtkWidget *widget,
+static void on_window1_size_request(GtkWidget *widget,
 				    GtkRequisition *requisition,
 				    gpointer user_data)
 {
@@ -441,7 +426,7 @@ void on_window1_size_request(GtkWidget *widget,
 	gtk_paned_set_position(GTK_PANED(vpaned), 2 * h / 3);
 }
 
-gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
+static gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
 					gpointer user_data)
 {
 	GtkWidget *dialog, *label;
@@ -488,7 +473,7 @@ gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
 	return ret;
 }
 
-void on_quit1_activate(GtkMenuItem *menuitem, gpointer user_data)
+static void on_quit1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
 	if (!on_window1_delete_event(NULL, NULL, NULL))
 		gtk_widget_destroy(GTK_WIDGET(main_wnd));
@@ -598,9 +583,9 @@ static gint column2index(GtkTreeViewColumn * column)
 
 
 /* User click: update choice (full) or goes down (single) */
-gboolean
-on_treeview2_button_press_event(GtkWidget * widget,
-				GdkEventButton * event, gpointer user_data)
+static gboolean on_treeview2_button_press_event(GtkWidget *widget,
+						GdkEventButton *event,
+						gpointer user_data)
 {
 	GtkTreeView *view = GTK_TREE_VIEW(widget);
 	GtkTreePath *path;
@@ -648,9 +633,9 @@ on_treeview2_button_press_event(GtkWidget * widget,
 }
 
 /* Key pressed: update choice */
-gboolean
-on_treeview2_key_press_event(GtkWidget * widget,
-			     GdkEventKey * event, gpointer user_data)
+static gboolean on_treeview2_key_press_event(GtkWidget *widget,
+					     GdkEventKey *event,
+					     gpointer user_data)
 {
 	GtkTreeView *view = GTK_TREE_VIEW(widget);
 	GtkTreePath *path;
@@ -690,8 +675,8 @@ on_treeview2_key_press_event(GtkWidget * widget,
 
 
 /* Row selection changed: update help */
-void
-on_treeview2_cursor_changed(GtkTreeView * treeview, gpointer user_data)
+static void on_treeview2_cursor_changed(GtkTreeView *treeview,
+					gpointer user_data)
 {
 	GtkTreeSelection *selection;
 	GtkTreeIter iter;
@@ -706,9 +691,9 @@ on_treeview2_cursor_changed(GtkTreeView * treeview, gpointer user_data)
 
 
 /* User click: display sub-tree in the right frame. */
-gboolean
-on_treeview1_button_press_event(GtkWidget * widget,
-				GdkEventButton * event, gpointer user_data)
+static gboolean on_treeview1_button_press_event(GtkWidget *widget,
+						GdkEventButton *event,
+						gpointer user_data)
 {
 	GtkTreeView *view = GTK_TREE_VIEW(widget);
 	GtkTreePath *path;
@@ -1138,47 +1123,129 @@ static void init_main_window(const gchar *glade_file)
 	glade_xml_signal_autoconnect(xml);
 
 	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, "delete_event",
+			 G_CALLBACK(on_window1_delete_event), NULL);
+
 	hpaned = glade_xml_get_widget(xml, "hpaned1");
 	vpaned = glade_xml_get_widget(xml, "vpaned1");
 	tree1_w = glade_xml_get_widget(xml, "treeview1");
+	g_signal_connect(tree1_w, "cursor_changed",
+			 G_CALLBACK(on_treeview2_cursor_changed), NULL);
+	g_signal_connect(tree1_w, "button_press_event",
+			 G_CALLBACK(on_treeview1_button_press_event), NULL);
+	g_signal_connect(tree1_w, "key_press_event",
+			 G_CALLBACK(on_treeview2_key_press_event), NULL);
+
 	tree2_w = glade_xml_get_widget(xml, "treeview2");
+	g_signal_connect(tree2_w, "cursor_changed",
+			 G_CALLBACK(on_treeview2_cursor_changed), NULL);
+	g_signal_connect(tree2_w, "button_press_event",
+			 G_CALLBACK(on_treeview2_button_press_event), NULL);
+	g_signal_connect(tree2_w, "key_press_event",
+			 G_CALLBACK(on_treeview2_key_press_event), NULL);
+
 	text_w = glade_xml_get_widget(xml, "textview3");
 
 	/* menubar */
+	widget = glade_xml_get_widget(xml, "load1");
+	g_signal_connect(widget, "activate", G_CALLBACK(on_load1_activate), NULL);
+
+	widget = glade_xml_get_widget(xml, "save1");
+	g_signal_connect(widget, "activate", G_CALLBACK(on_save_activate), NULL);
+
+	widget = glade_xml_get_widget(xml, "save_as1");
+	g_signal_connect(widget, "activate", G_CALLBACK(on_save_as1_activate), NULL);
+
+	widget = glade_xml_get_widget(xml, "quit1");
+	g_signal_connect(widget, "activate", G_CALLBACK(on_quit1_activate), NULL);
+
 	widget = glade_xml_get_widget(xml, "show_name1");
+	g_signal_connect(widget, "activate", G_CALLBACK(on_show_name1_activate), NULL);
 	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
 				       show_name);
 
 	widget = glade_xml_get_widget(xml, "show_range1");
+	g_signal_connect(widget, "activate", G_CALLBACK(on_show_range1_activate), NULL);
 	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
 				       show_range);
 
 	widget = glade_xml_get_widget(xml, "show_data1");
+	g_signal_connect(widget, "activate", G_CALLBACK(on_show_data1_activate), NULL);
 	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
 				       show_value);
 
+	widget = glade_xml_get_widget(xml, "set_option_mode1");
+	g_signal_connect(widget, "activate",
+			 G_CALLBACK(on_set_option_mode1_activate), NULL);
+
+	widget = glade_xml_get_widget(xml, "set_option_mode2");
+	g_signal_connect(widget, "activate",
+			 G_CALLBACK(on_set_option_mode2_activate), NULL);
+
+	widget = glade_xml_get_widget(xml, "set_option_mode3");
+	g_signal_connect(widget, "activate",
+			 G_CALLBACK(on_set_option_mode3_activate), NULL);
+
+	widget = glade_xml_get_widget(xml, "introduction1");
+	g_signal_connect(widget, "activate",
+			 G_CALLBACK(on_introduction1_activate), NULL);
+
+	widget = glade_xml_get_widget(xml, "about1");
+	g_signal_connect(widget, "activate",
+			 G_CALLBACK(on_about1_activate), NULL);
+
+	widget = glade_xml_get_widget(xml, "license1");
+	g_signal_connect(widget, "activate",
+			 G_CALLBACK(on_license1_activate), NULL);
+
 	/* toolbar */
 	back_btn = glade_xml_get_widget(xml, "button1");
+	g_signal_connect(back_btn, "clicked",
+			 G_CALLBACK(on_back_clicked), NULL);
 	gtk_widget_set_sensitive(back_btn, FALSE);
 
+	widget = glade_xml_get_widget(xml, "button2");
+	g_signal_connect(widget, "clicked",
+			 G_CALLBACK(on_load_clicked), NULL);
+
 	save_btn = glade_xml_get_widget(xml, "button3");
+	g_signal_connect(save_btn, "clicked",
+			 G_CALLBACK(on_save_activate), NULL);
 	save_menu_item = glade_xml_get_widget(xml, "save1");
 	conf_set_changed_callback(conf_changed);
 
 	style = gtk_widget_get_style(main_wnd);
 
 	single_btn = glade_xml_get_widget(xml, "button4");
+	g_signal_connect(single_btn, "clicked",
+			 G_CALLBACK(on_single_clicked), NULL);
 	replace_button_icon(xml, main_wnd->window, style,
 			    "button4", (gchar **) xpm_single_view);
 
 	split_btn = glade_xml_get_widget(xml, "button5");
+	g_signal_connect(split_btn, "clicked",
+			 G_CALLBACK(on_split_clicked), NULL);
 	replace_button_icon(xml, main_wnd->window, style,
 			    "button5", (gchar **) xpm_split_view);
 
 	full_btn = glade_xml_get_widget(xml, "button6");
+	g_signal_connect(full_btn, "clicked",
+			 G_CALLBACK(on_full_clicked), NULL);
 	replace_button_icon(xml, main_wnd->window, style,
 			    "button6", (gchar **) xpm_tree_view);
 
+	widget = glade_xml_get_widget(xml, "button7");
+	g_signal_connect(widget, "clicked",
+			 G_CALLBACK(on_collapse_clicked), NULL);
+
+	widget = glade_xml_get_widget(xml, "button8");
+	g_signal_connect(widget, "clicked",
+			 G_CALLBACK(on_expand_clicked), NULL);
+
 	txtbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w));
 	tag1 = gtk_text_buffer_create_tag(txtbuf, "mytag1",
 					  "foreground", "red",
diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.glade
index 19b80f2ec1ff..8519104a3c2b 100644
--- a/scripts/kconfig/gconf.glade
+++ b/scripts/kconfig/gconf.glade
@@ -17,9 +17,6 @@
   <property name="skip_pager_hint">False</property>
   <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
   <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
-  <signal name="destroy" handler="on_window1_destroy" object="window1"/>
-  <signal name="size_request" handler="on_window1_size_request" object="vpaned1" last_modification_time="Fri, 11 Jan 2002 16:17:11 GMT"/>
-  <signal name="delete_event" handler="on_window1_delete_event" object="window1" last_modification_time="Sun, 09 Mar 2003 19:42:46 GMT"/>
 
   <child>
     <widget class="GtkVBox" id="vbox1">
@@ -46,7 +43,6 @@
 		      <property name="tooltip" translatable="yes">Load a config file</property>
 		      <property name="label" translatable="yes">_Load</property>
 		      <property name="use_underline">True</property>
-		      <signal name="activate" handler="on_load1_activate"/>
 		      <accelerator key="L" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 		    </widget>
 		  </child>
@@ -57,7 +53,6 @@
 		      <property name="tooltip" translatable="yes">Save the config in .config</property>
 		      <property name="label" translatable="yes">_Save</property>
 		      <property name="use_underline">True</property>
-		      <signal name="activate" handler="on_save_activate"/>
 		      <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 		    </widget>
 		  </child>
@@ -68,7 +63,6 @@
 		      <property name="tooltip" translatable="yes">Save the config in a file</property>
 		      <property name="label" translatable="yes">Save _as</property>
 		      <property name="use_underline">True</property>
-		      <signal name="activate" handler="on_save_as1_activate"/>
 		    </widget>
 		  </child>
 
@@ -83,7 +77,6 @@
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">_Quit</property>
 		      <property name="use_underline">True</property>
-		      <signal name="activate" handler="on_quit1_activate"/>
 		      <accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 		    </widget>
 		  </child>
@@ -108,7 +101,6 @@
 		      <property name="label" translatable="yes">Show _name</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
-		      <signal name="activate" handler="on_show_name1_activate"/>
 		    </widget>
 		  </child>
 
@@ -119,7 +111,6 @@
 		      <property name="label" translatable="yes">Show _range</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
-		      <signal name="activate" handler="on_show_range1_activate"/>
 		    </widget>
 		  </child>
 
@@ -130,7 +121,6 @@
 		      <property name="label" translatable="yes">Show _data</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
-		      <signal name="activate" handler="on_show_data1_activate"/>
 		    </widget>
 		  </child>
 
@@ -147,7 +137,6 @@
 		      <property name="label" translatable="yes">Show normal options</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">True</property>
-		      <signal name="activate" handler="on_set_option_mode1_activate"/>
 		    </widget>
 		  </child>
 
@@ -159,7 +148,6 @@
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
 		      <property name="group">set_option_mode1</property>
-		      <signal name="activate" handler="on_set_option_mode2_activate"/>
 		    </widget>
 		  </child>
 
@@ -171,7 +159,6 @@
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
 		      <property name="group">set_option_mode1</property>
-		      <signal name="activate" handler="on_set_option_mode3_activate"/>
 		    </widget>
 		  </child>
 
@@ -194,7 +181,6 @@
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">_Introduction</property>
 		      <property name="use_underline">True</property>
-		      <signal name="activate" handler="on_introduction1_activate" last_modification_time="Fri, 15 Nov 2002 20:26:30 GMT"/>
 		      <accelerator key="I" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 		    </widget>
 		  </child>
@@ -204,7 +190,6 @@
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">_About</property>
 		      <property name="use_underline">True</property>
-		      <signal name="activate" handler="on_about1_activate" last_modification_time="Fri, 15 Nov 2002 20:26:30 GMT"/>
 		      <accelerator key="A" modifiers="GDK_CONTROL_MASK" signal="activate"/>
 		    </widget>
 		  </child>
@@ -214,7 +199,6 @@
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">_License</property>
 		      <property name="use_underline">True</property>
-		      <signal name="activate" handler="on_license1_activate" last_modification_time="Fri, 15 Nov 2002 20:26:30 GMT"/>
 		    </widget>
 		  </child>
 		</widget>
@@ -254,7 +238,6 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		  <signal name="clicked" handler="on_back_clicked"/>
 		</widget>
 		<packing>
 		  <property name="expand">False</property>
@@ -291,7 +274,6 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		  <signal name="clicked" handler="on_load_clicked"/>
 		</widget>
 		<packing>
 		  <property name="expand">False</property>
@@ -309,7 +291,6 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		  <signal name="clicked" handler="on_save_activate"/>
 		</widget>
 		<packing>
 		  <property name="expand">False</property>
@@ -346,7 +327,6 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		  <signal name="clicked" handler="on_single_clicked" last_modification_time="Sun, 12 Jan 2003 14:28:39 GMT"/>
 		</widget>
 		<packing>
 		  <property name="expand">False</property>
@@ -364,7 +344,6 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		  <signal name="clicked" handler="on_split_clicked" last_modification_time="Sun, 12 Jan 2003 14:28:45 GMT"/>
 		</widget>
 		<packing>
 		  <property name="expand">False</property>
@@ -382,7 +361,6 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		  <signal name="clicked" handler="on_full_clicked" last_modification_time="Sun, 12 Jan 2003 14:28:50 GMT"/>
 		</widget>
 		<packing>
 		  <property name="expand">False</property>
@@ -419,7 +397,6 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		  <signal name="clicked" handler="on_collapse_clicked"/>
 		</widget>
 		<packing>
 		  <property name="expand">False</property>
@@ -437,7 +414,6 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		  <signal name="clicked" handler="on_expand_clicked"/>
 		</widget>
 		<packing>
 		  <property name="expand">False</property>
@@ -477,9 +453,6 @@
 		  <property name="rules_hint">False</property>
 		  <property name="reorderable">False</property>
 		  <property name="enable_search">False</property>
-		  <signal name="cursor_changed" handler="on_treeview2_cursor_changed" last_modification_time="Sun, 12 Jan 2003 15:58:22 GMT"/>
-		  <signal name="button_press_event" handler="on_treeview1_button_press_event" last_modification_time="Sun, 12 Jan 2003 16:03:52 GMT"/>
-		  <signal name="key_press_event" handler="on_treeview2_key_press_event" last_modification_time="Sun, 12 Jan 2003 16:11:44 GMT"/>
 		</widget>
 	      </child>
 	    </widget>
@@ -512,9 +485,6 @@
 		      <property name="rules_hint">False</property>
 		      <property name="reorderable">False</property>
 		      <property name="enable_search">False</property>
-		      <signal name="cursor_changed" handler="on_treeview2_cursor_changed" last_modification_time="Sun, 12 Jan 2003 15:57:55 GMT"/>
-		      <signal name="button_press_event" handler="on_treeview2_button_press_event" last_modification_time="Sun, 12 Jan 2003 15:57:58 GMT"/>
-		      <signal name="key_press_event" handler="on_treeview2_key_press_event" last_modification_time="Sun, 12 Jan 2003 15:58:01 GMT"/>
 		    </widget>
 		  </child>
 		</widget>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 30/66] kconfig: gconf: remove glade_xml_signal_autoconnect() call
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (28 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 29/66] kconfig: gconf: add static qualifiers to event handlers Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-30  2:58   ` Randy Dunlap
  2025-06-24 15:05 ` [PATCH 31/66] kconfig: gconf: make key_press_event work in left pane too Masahiro Yamada
                   ` (36 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

Now that all signals are connected manually, this is no longer
unnecessary.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 02bbb7ce4c4a..09537245213a 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -1120,7 +1120,6 @@ static void init_main_window(const gchar *glade_file)
 	xml = glade_xml_new(glade_file, "window1", NULL);
 	if (!xml)
 		g_error("GUI loading failed !\n");
-	glade_xml_signal_autoconnect(xml);
 
 	main_wnd = glade_xml_get_widget(xml, "window1");
 	g_signal_connect(main_wnd, "destroy",
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 31/66] kconfig: gconf: make key_press_event work in left pane too
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (29 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 30/66] kconfig: gconf: remove glade_xml_signal_autoconnect() call Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 32/66] kconfig: gconf: avoid hardcoding model2 in on_treeview2_cursor_changed() Masahiro Yamada
                   ` (35 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

Currently, on_treeview2_key_press_event() returns early for the tree1
widget. We can make it work on the left pane as well by avoiding the
hardcoded use of model2.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 09537245213a..51d987c8ffaf 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -638,6 +638,7 @@ static gboolean on_treeview2_key_press_event(GtkWidget *widget,
 					     gpointer user_data)
 {
 	GtkTreeView *view = GTK_TREE_VIEW(widget);
+	GtkTreeModel *model = gtk_tree_view_get_model(view);
 	GtkTreePath *path;
 	GtkTreeIter iter;
 	struct menu *menu;
@@ -654,11 +655,9 @@ static gboolean on_treeview2_key_press_event(GtkWidget *widget,
 			gtk_tree_view_expand_row(view, path, FALSE);
 		return TRUE;
 	}
-	if (widget == tree1_w)
-		return FALSE;
 
-	gtk_tree_model_get_iter(model2, &iter, path);
-	gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
+	gtk_tree_model_get_iter(model, &iter, path);
+	gtk_tree_model_get(model, &iter, COL_MENU, &menu, -1);
 
 	if (!strcasecmp(event->string, "n"))
 		col = COL_NO;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 32/66] kconfig: gconf: avoid hardcoding model2 in on_treeview2_cursor_changed()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (30 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 31/66] kconfig: gconf: make key_press_event work in left pane too Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 33/66] kconfig: gconf: avoid hardcoding model2 in renderer_edited() Masahiro Yamada
                   ` (34 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The on_treeview2_cursor_changed() handler is connected to both the left
and right tree views, but it hardcodes model2 (the GtkTreeModel of the
right tree view). This is incorrect. Get the associated model from the
view.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 51d987c8ffaf..2d7a556eddaf 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -677,13 +677,14 @@ static gboolean on_treeview2_key_press_event(GtkWidget *widget,
 static void on_treeview2_cursor_changed(GtkTreeView *treeview,
 					gpointer user_data)
 {
+	GtkTreeModel *model = gtk_tree_view_get_model(treeview);
 	GtkTreeSelection *selection;
 	GtkTreeIter iter;
 	struct menu *menu;
 
 	selection = gtk_tree_view_get_selection(treeview);
-	if (gtk_tree_selection_get_selected(selection, &model2, &iter)) {
-		gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
+	if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
+		gtk_tree_model_get(model, &iter, COL_MENU, &menu, -1);
 		text_insert_help(menu);
 	}
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 33/66] kconfig: gconf: avoid hardcoding model2 in renderer_edited()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (31 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 32/66] kconfig: gconf: avoid hardcoding model2 in on_treeview2_cursor_changed() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 34/66] kconfig: gconf: avoid hardcoding model* in on_treeview*_button_press_event() Masahiro Yamada
                   ` (33 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

Although this is only used in the right tree view, it is better not to
hardcode model2 for consistency.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 2d7a556eddaf..66c58a15b717 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -486,19 +486,21 @@ static void renderer_edited(GtkCellRendererText * cell,
 			    const gchar * path_string,
 			    const gchar * new_text, gpointer user_data)
 {
+	GtkTreeView *view = GTK_TREE_VIEW(user_data);
+	GtkTreeModel *model = gtk_tree_view_get_model(view);
 	GtkTreePath *path = gtk_tree_path_new_from_string(path_string);
 	GtkTreeIter iter;
 	const char *old_def, *new_def;
 	struct menu *menu;
 	struct symbol *sym;
 
-	if (!gtk_tree_model_get_iter(model2, &iter, path))
+	if (!gtk_tree_model_get_iter(model, &iter, path))
 		goto free;
 
-	gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
+	gtk_tree_model_get(model, &iter, COL_MENU, &menu, -1);
 	sym = menu->sym;
 
-	gtk_tree_model_get(model2, &iter, COL_VALUE, &old_def, -1);
+	gtk_tree_model_get(model, &iter, COL_VALUE, &old_def, -1);
 	new_def = new_text;
 
 	sym_set_string_value(sym, new_def);
@@ -1391,7 +1393,7 @@ static void init_right_tree(void)
 						    "foreground-gdk",
 						    COL_COLOR, NULL);
 	g_signal_connect(G_OBJECT(renderer), "edited",
-			 G_CALLBACK(renderer_edited), NULL);
+			 G_CALLBACK(renderer_edited), tree2_w);
 
 	for (i = 0; i < COL_VALUE; i++) {
 		column = gtk_tree_view_get_column(view, i);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 34/66] kconfig: gconf: avoid hardcoding model* in on_treeview*_button_press_event()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (32 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 33/66] kconfig: gconf: avoid hardcoding model2 in renderer_edited() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 35/66] kconfig: gconf: add on_save_clicked() event handler Masahiro Yamada
                   ` (32 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

It is better not to hardcode model1 or model2 for consistency.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 66c58a15b717..6972acb4b396 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -590,6 +590,7 @@ static gboolean on_treeview2_button_press_event(GtkWidget *widget,
 						gpointer user_data)
 {
 	GtkTreeView *view = GTK_TREE_VIEW(widget);
+	GtkTreeModel *model = gtk_tree_view_get_model(view);
 	GtkTreePath *path;
 	GtkTreeViewColumn *column;
 	GtkTreeIter iter;
@@ -602,9 +603,9 @@ static gboolean on_treeview2_button_press_event(GtkWidget *widget,
 	if (path == NULL)
 		return FALSE;
 
-	if (!gtk_tree_model_get_iter(model2, &iter, path))
+	if (!gtk_tree_model_get_iter(model, &iter, path))
 		return FALSE;
-	gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
+	gtk_tree_model_get(model, &iter, COL_MENU, &menu, -1);
 
 	col = column2index(column);
 	if (event->type == GDK_2BUTTON_PRESS) {
@@ -698,6 +699,7 @@ static gboolean on_treeview1_button_press_event(GtkWidget *widget,
 						gpointer user_data)
 {
 	GtkTreeView *view = GTK_TREE_VIEW(widget);
+	GtkTreeModel *model = gtk_tree_view_get_model(view);
 	GtkTreePath *path;
 	GtkTreeIter iter;
 	struct menu *menu;
@@ -708,8 +710,8 @@ static gboolean on_treeview1_button_press_event(GtkWidget *widget,
 	if (path == NULL)
 		return FALSE;
 
-	gtk_tree_model_get_iter(model1, &iter, path);
-	gtk_tree_model_get(model1, &iter, COL_MENU, &menu, -1);
+	gtk_tree_model_get_iter(model, &iter, path);
+	gtk_tree_model_get(model, &iter, COL_MENU, &menu, -1);
 
 	if (event->type == GDK_2BUTTON_PRESS) {
 		toggle_sym_value(menu);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 35/66] kconfig: gconf: add on_save_clicked() event handler
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (33 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 34/66] kconfig: gconf: avoid hardcoding model* in on_treeview*_button_press_event() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 36/66] kconfig: gconf: use GtkFileChooser in on_load1_activate() Masahiro Yamada
                   ` (31 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The "clicked" event handler for GtkToolButton takes the GtkToolButton*
as the first parameter.

This is different from the existing on_save_activate() handler.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 6972acb4b396..8c60b9f25eaa 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -375,6 +375,11 @@ static void on_load_clicked(GtkButton *button, gpointer user_data)
 	on_load1_activate(NULL, user_data);
 }
 
+static void on_save_clicked(GtkButton *button, gpointer user_data)
+{
+	on_save_activate(NULL, user_data);
+}
+
 static void on_single_clicked(GtkButton *button, gpointer user_data)
 {
 	set_view_mode(SINGLE_VIEW);
@@ -1217,7 +1222,7 @@ static void init_main_window(const gchar *glade_file)
 
 	save_btn = glade_xml_get_widget(xml, "button3");
 	g_signal_connect(save_btn, "clicked",
-			 G_CALLBACK(on_save_activate), NULL);
+			 G_CALLBACK(on_save_clicked), NULL);
 	save_menu_item = glade_xml_get_widget(xml, "save1");
 	conf_set_changed_callback(conf_changed);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 36/66] kconfig: gconf: use GtkFileChooser in on_load1_activate()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (34 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 35/66] kconfig: gconf: add on_save_clicked() event handler Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-30  3:14   ` Randy Dunlap
  2025-06-24 15:05 ` [PATCH 37/66] kconfig: gconf: use GtkFileChooser in on_save_as1_activate() Masahiro Yamada
                   ` (30 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

gtk_file_selection_new() is deprecated, and gtk_file_chooser_dialog_new()
should be used instead. [1]

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/docs/reference/gtk/tmpl/gtkfilesel.sgml?ref_type=tags#L156

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 58 ++++++++++++++++++++---------------------
 1 file changed, 29 insertions(+), 29 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 8c60b9f25eaa..f33f39d50f3d 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -157,38 +157,38 @@ static void text_insert_msg(const char *title, const char *message)
 
 /* Menu & Toolbar Callbacks */
 
-
-static void
-load_filename(GtkFileSelection * file_selector, gpointer user_data)
-{
-	const gchar *fn;
-
-	fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION
-					     (user_data));
-
-	if (conf_read(fn))
-		text_insert_msg("Error", "Unable to load configuration !");
-	else
-		display_tree_part();
-}
-
 static void on_load1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
-	GtkWidget *fs;
+	GtkWidget *dialog;
+	GtkFileChooser *chooser;
+	gint res;
 
-	fs = gtk_file_selection_new("Load file...");
-	g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
-			 "clicked",
-			 G_CALLBACK(load_filename), (gpointer) fs);
-	g_signal_connect_swapped(GTK_OBJECT
-				 (GTK_FILE_SELECTION(fs)->ok_button),
-				 "clicked", G_CALLBACK(gtk_widget_destroy),
-				 (gpointer) fs);
-	g_signal_connect_swapped(GTK_OBJECT
-				 (GTK_FILE_SELECTION(fs)->cancel_button),
-				 "clicked", G_CALLBACK(gtk_widget_destroy),
-				 (gpointer) fs);
-	gtk_widget_show(fs);
+	dialog = gtk_file_chooser_dialog_new("Load file...",
+					     GTK_WINDOW(user_data),
+					     GTK_FILE_CHOOSER_ACTION_OPEN,
+					     "_Cancel", GTK_RESPONSE_CANCEL,
+					     "_Open", GTK_RESPONSE_ACCEPT,
+					     NULL);
+
+	chooser = GTK_FILE_CHOOSER(dialog);
+	gtk_file_chooser_set_filename(chooser, conf_get_configname());
+
+	res = gtk_dialog_run(GTK_DIALOG(dialog));
+	if (res == GTK_RESPONSE_ACCEPT) {
+		char *filename;
+
+		filename = gtk_file_chooser_get_filename(chooser);
+
+		if (conf_read(filename))
+			text_insert_msg("Error",
+					"Unable to load configuration!");
+		else
+			display_tree_part();
+
+		g_free(filename);
+	}
+
+	gtk_widget_destroy(GTK_WIDGET(dialog));
 }
 
 static void on_save_activate(GtkMenuItem *menuitem, gpointer user_data)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 37/66] kconfig: gconf: use GtkFileChooser in on_save_as1_activate()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (35 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 36/66] kconfig: gconf: use GtkFileChooser in on_load1_activate() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-30  3:20   ` Randy Dunlap
  2025-06-24 15:05 ` [PATCH 38/66] kconfig: gconf: use GdkPixbuf in replace_button_icon() Masahiro Yamada
                   ` (29 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

gtk_file_selection_new() is deprecated, and gtk_file_chooser_dialog_new()
should be used instead. [1]

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/docs/reference/gtk/tmpl/gtkfilesel.sgml?ref_type=tags#L156

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 56 ++++++++++++++++++++---------------------
 1 file changed, 27 insertions(+), 29 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index f33f39d50f3d..b019711142c3 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -198,38 +198,36 @@ static void on_save_activate(GtkMenuItem *menuitem, gpointer user_data)
 	conf_write_autoconf(0);
 }
 
-
-static void
-store_filename(GtkFileSelection * file_selector, gpointer user_data)
-{
-	const gchar *fn;
-
-	fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION
-					     (user_data));
-
-	if (conf_write(fn))
-		text_insert_msg("Error", "Unable to save configuration !");
-
-	gtk_widget_destroy(GTK_WIDGET(user_data));
-}
-
 static void on_save_as1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
-	GtkWidget *fs;
+	GtkWidget *dialog;
+	GtkFileChooser *chooser;
+	gint res;
 
-	fs = gtk_file_selection_new("Save file as...");
-	g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
-			 "clicked",
-			 G_CALLBACK(store_filename), (gpointer) fs);
-	g_signal_connect_swapped(GTK_OBJECT
-				 (GTK_FILE_SELECTION(fs)->ok_button),
-				 "clicked", G_CALLBACK(gtk_widget_destroy),
-				 (gpointer) fs);
-	g_signal_connect_swapped(GTK_OBJECT
-				 (GTK_FILE_SELECTION(fs)->cancel_button),
-				 "clicked", G_CALLBACK(gtk_widget_destroy),
-				 (gpointer) fs);
-	gtk_widget_show(fs);
+	dialog = gtk_file_chooser_dialog_new("Save file as...",
+					     GTK_WINDOW(user_data),
+					     GTK_FILE_CHOOSER_ACTION_SAVE,
+					     "_Cancel", GTK_RESPONSE_CANCEL,
+					     "_Save", GTK_RESPONSE_ACCEPT,
+					     NULL);
+
+	chooser = GTK_FILE_CHOOSER(dialog);
+	gtk_file_chooser_set_filename(chooser, conf_get_configname());
+
+	res = gtk_dialog_run(GTK_DIALOG(dialog));
+	if (res == GTK_RESPONSE_ACCEPT) {
+		char *filename;
+
+		filename = gtk_file_chooser_get_filename(chooser);
+
+		if (conf_write(filename))
+			text_insert_msg("Error",
+					"Unable to save configuration !");
+
+		g_free(filename);
+	}
+
+	gtk_widget_destroy(dialog);
 }
 
 static void on_show_name1_activate(GtkMenuItem *menuitem, gpointer user_data)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 38/66] kconfig: gconf: use GdkPixbuf in replace_button_icon()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (36 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 37/66] kconfig: gconf: use GtkFileChooser in on_save_as1_activate() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 39/66] kconfig: gconf: refactor replace_button_icon() Masahiro Yamada
                   ` (28 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

gdk_pixmap_create_from_xpm_d has been deprecated since version 2.22.
Use a GdkPixbuf instead. You can use gdk_pixbuf_new_from_xpm_data() to
create it. [1]

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gdk/gdkpixmap.c#L742

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index b019711142c3..30d8fdb886c0 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -1102,17 +1102,16 @@ static void fixup_rootmenu(struct menu *menu)
 static void replace_button_icon(GladeXML *xml, GdkDrawable *window,
 				GtkStyle *style, gchar *btn_name, gchar **xpm)
 {
-	GdkPixmap *pixmap;
-	GdkBitmap *mask;
-	GtkToolButton *button;
+	GdkPixbuf *pixbuf;
 	GtkWidget *image;
+	GtkToolButton *button;
 
-	pixmap = gdk_pixmap_create_from_xpm_d(window, &mask,
-					      &style->bg[GTK_STATE_NORMAL],
-					      xpm);
+	pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)xpm);
+	image = gtk_image_new_from_pixbuf(pixbuf);
+	g_object_unref(pixbuf);
 
 	button = GTK_TOOL_BUTTON(glade_xml_get_widget(xml, btn_name));
-	image = gtk_image_new_from_pixmap(pixmap, mask);
+
 	gtk_widget_show(image);
 	gtk_tool_button_set_icon_widget(button, image);
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 39/66] kconfig: gconf: refactor replace_button_icon()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (37 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 38/66] kconfig: gconf: use GdkPixbuf in replace_button_icon() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 40/66] kconfig: gconf: make introduction, about, license dialogs modal Masahiro Yamada
                   ` (27 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The "window" and "style" arguments for replace_button_icon() are
now unused. Remove them and refactor the function accordingly.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 30d8fdb886c0..e20cbceb89d3 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -1099,21 +1099,17 @@ static void fixup_rootmenu(struct menu *menu)
 }
 
 /* Main Window Initialization */
-static void replace_button_icon(GladeXML *xml, GdkDrawable *window,
-				GtkStyle *style, gchar *btn_name, gchar **xpm)
+static void replace_button_icon(GtkWidget *widget, const char * const xpm[])
 {
 	GdkPixbuf *pixbuf;
 	GtkWidget *image;
-	GtkToolButton *button;
 
 	pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)xpm);
 	image = gtk_image_new_from_pixbuf(pixbuf);
 	g_object_unref(pixbuf);
 
-	button = GTK_TOOL_BUTTON(glade_xml_get_widget(xml, btn_name));
-
 	gtk_widget_show(image);
-	gtk_tool_button_set_icon_widget(button, image);
+	gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(widget), image);
 }
 
 static void init_main_window(const gchar *glade_file)
@@ -1121,7 +1117,6 @@ static void init_main_window(const gchar *glade_file)
 	GladeXML *xml;
 	GtkWidget *widget;
 	GtkTextBuffer *txtbuf;
-	GtkStyle *style;
 
 	xml = glade_xml_new(glade_file, "window1", NULL);
 	if (!xml)
@@ -1223,25 +1218,20 @@ static void init_main_window(const gchar *glade_file)
 	save_menu_item = glade_xml_get_widget(xml, "save1");
 	conf_set_changed_callback(conf_changed);
 
-	style = gtk_widget_get_style(main_wnd);
-
 	single_btn = glade_xml_get_widget(xml, "button4");
 	g_signal_connect(single_btn, "clicked",
 			 G_CALLBACK(on_single_clicked), NULL);
-	replace_button_icon(xml, main_wnd->window, style,
-			    "button4", (gchar **) xpm_single_view);
+	replace_button_icon(single_btn, xpm_single_view);
 
 	split_btn = glade_xml_get_widget(xml, "button5");
 	g_signal_connect(split_btn, "clicked",
 			 G_CALLBACK(on_split_clicked), NULL);
-	replace_button_icon(xml, main_wnd->window, style,
-			    "button5", (gchar **) xpm_split_view);
+	replace_button_icon(split_btn, xpm_split_view);
 
 	full_btn = glade_xml_get_widget(xml, "button6");
 	g_signal_connect(full_btn, "clicked",
 			 G_CALLBACK(on_full_clicked), NULL);
-	replace_button_icon(xml, main_wnd->window, style,
-			    "button6", (gchar **) xpm_tree_view);
+	replace_button_icon(full_btn, xpm_tree_view);
 
 	widget = glade_xml_get_widget(xml, "button7");
 	g_signal_connect(widget, "clicked",
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 40/66] kconfig: gconf: make introduction, about, license dialogs modal
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (38 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 39/66] kconfig: gconf: refactor replace_button_icon() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-30  4:09   ` Randy Dunlap
  2025-06-24 15:05 ` [PATCH 41/66] kconfig: gconf: remove global 'tree' variable Masahiro Yamada
                   ` (26 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

These are modal dialogs in xconfig. Make them modal in gconfig as well.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index e20cbceb89d3..67305577b432 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -312,10 +312,8 @@ static void on_introduction1_activate(GtkMenuItem *menuitem, gpointer user_data)
 					GTK_DIALOG_DESTROY_WITH_PARENT,
 					GTK_MESSAGE_INFO,
 					GTK_BUTTONS_CLOSE, "%s", intro_text);
-	g_signal_connect_swapped(GTK_OBJECT(dialog), "response",
-				 G_CALLBACK(gtk_widget_destroy),
-				 GTK_OBJECT(dialog));
-	gtk_widget_show_all(dialog);
+	gtk_dialog_run(GTK_DIALOG(dialog));
+	gtk_widget_destroy(dialog);
 }
 
 static void on_about1_activate(GtkMenuItem *menuitem, gpointer user_data)
@@ -329,10 +327,8 @@ static void on_about1_activate(GtkMenuItem *menuitem, gpointer user_data)
 					GTK_DIALOG_DESTROY_WITH_PARENT,
 					GTK_MESSAGE_INFO,
 					GTK_BUTTONS_CLOSE, "%s", about_text);
-	g_signal_connect_swapped(GTK_OBJECT(dialog), "response",
-				 G_CALLBACK(gtk_widget_destroy),
-				 GTK_OBJECT(dialog));
-	gtk_widget_show_all(dialog);
+	gtk_dialog_run(GTK_DIALOG(dialog));
+	gtk_widget_destroy(dialog);
 }
 
 static void on_license1_activate(GtkMenuItem *menuitem, gpointer user_data)
@@ -347,10 +343,8 @@ static void on_license1_activate(GtkMenuItem *menuitem, gpointer user_data)
 					GTK_DIALOG_DESTROY_WITH_PARENT,
 					GTK_MESSAGE_INFO,
 					GTK_BUTTONS_CLOSE, "%s", license_text);
-	g_signal_connect_swapped(GTK_OBJECT(dialog), "response",
-				 G_CALLBACK(gtk_widget_destroy),
-				 GTK_OBJECT(dialog));
-	gtk_widget_show_all(dialog);
+	gtk_dialog_run(GTK_DIALOG(dialog));
+	gtk_widget_destroy(dialog);
 }
 
 /* toolbar handlers */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 41/66] kconfig: gconf: remove global 'tree' variable
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (39 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 40/66] kconfig: gconf: make introduction, about, license dialogs modal Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 42/66] kconfig: gconf: merge 'current' and 'browsed' global variables Masahiro Yamada
                   ` (25 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

Pass the tree store as a function parameter to make it clearer which
tree is being updated.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 42 ++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 67305577b432..cfe65baa4f18 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -43,7 +43,7 @@ static GtkWidget *save_menu_item;
 
 static GtkTextTag *tag1, *tag2;
 
-static GtkTreeStore *tree1, *tree2, *tree;
+static GtkTreeStore *tree1, *tree2;
 static GtkTreeModel *model1, *model2;
 
 static struct menu *current; // current node for SINGLE view
@@ -57,7 +57,7 @@ enum {
 };
 
 static void display_list(void);
-static void display_tree(struct menu *menu);
+static void display_tree(GtkTreeStore *store, struct menu *menu);
 static void display_tree_part(void);
 static void update_tree(struct menu *src, GtkTreeIter * dst);
 
@@ -101,7 +101,7 @@ static void set_view_mode(enum view_mode mode)
 		break;
 	case FULL_VIEW:
 		gtk_tree_store_clear(tree2);
-		display_tree(&rootmenu);
+		display_tree(tree2, &rootmenu);
 		gtk_widget_set_sensitive(full_btn, FALSE);
 		break;
 	}
@@ -272,7 +272,7 @@ static void on_set_option_mode1_activate(GtkMenuItem *menuitem,
 {
 	opt_mode = OPT_NORMAL;
 	gtk_tree_store_clear(tree2);
-	display_tree(&rootmenu);	/* instead of update_tree to speed-up */
+	display_tree(tree2, &rootmenu);	/* instead of update_tree to speed-up */
 }
 
 static void on_set_option_mode2_activate(GtkMenuItem *menuitem,
@@ -280,7 +280,7 @@ static void on_set_option_mode2_activate(GtkMenuItem *menuitem,
 {
 	opt_mode = OPT_ALL;
 	gtk_tree_store_clear(tree2);
-	display_tree(&rootmenu);	/* instead of update_tree to speed-up */
+	display_tree(tree2, &rootmenu);	/* instead of update_tree to speed-up */
 }
 
 static void on_set_option_mode3_activate(GtkMenuItem *menuitem,
@@ -288,7 +288,7 @@ static void on_set_option_mode3_activate(GtkMenuItem *menuitem,
 {
 	opt_mode = OPT_PROMPT;
 	gtk_tree_store_clear(tree2);
-	display_tree(&rootmenu);	/* instead of update_tree to speed-up */
+	display_tree(tree2, &rootmenu);	/* instead of update_tree to speed-up */
 }
 
 static void on_introduction1_activate(GtkMenuItem *menuitem, gpointer user_data)
@@ -852,7 +852,8 @@ static gchar **fill_row(struct menu *menu)
 
 
 /* Set the node content with a row of strings */
-static void set_node(GtkTreeIter * node, struct menu *menu, gchar ** row)
+static void set_node(GtkTreeStore *tree, GtkTreeIter *node,
+		     struct menu *menu, gchar **row)
 {
 	GdkColor color;
 	gboolean success;
@@ -976,7 +977,7 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
 				gtk_tree_store_insert_before(tree2,
 							     child2,
 							     dst, sibling);
-				set_node(child2, menu1, fill_row(menu1));
+				set_node(tree2, child2, menu1, fill_row(menu1));
 				if (menu2 == NULL)
 					valid = TRUE;
 			} else {	// remove node
@@ -990,7 +991,7 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
 					goto reparse;	// next child
 			}
 		} else if (sym && (child1->flags & MENU_CHANGED)) {
-			set_node(child2, menu1, fill_row(menu1));
+			set_node(tree2, child2, menu1, fill_row(menu1));
 		}
 
 		update_tree(child1, child2);
@@ -1001,7 +1002,8 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
 
 
 /* Display the whole tree (single/split/full view) */
-static void _display_tree(struct menu *menu, GtkTreeIter *parent)
+static void _display_tree(GtkTreeStore *tree, struct menu *menu,
+			  GtkTreeIter *parent)
 {
 	struct property *prop;
 	struct menu *child;
@@ -1029,7 +1031,7 @@ static void _display_tree(struct menu *menu, GtkTreeIter *parent)
 		    (opt_mode == OPT_PROMPT && menu_has_prompt(child)) ||
 		    (opt_mode == OPT_ALL    && menu_get_prompt(child))) {
 			gtk_tree_store_append(tree, &iter, parent);
-			set_node(&iter, child, fill_row(child));
+			set_node(tree, &iter, child, fill_row(child));
 		}
 
 		if ((view_mode != FULL_VIEW) && (ptype == P_MENU)
@@ -1043,13 +1045,13 @@ static void _display_tree(struct menu *menu, GtkTreeIter *parent)
 		if (((view_mode == SINGLE_VIEW) && (menu->flags & MENU_ROOT))
 		    || (view_mode == FULL_VIEW)
 		    || (view_mode == SPLIT_VIEW))
-			_display_tree(child, &iter);
+			_display_tree(tree, child, &iter);
 	}
 }
 
-static void display_tree(struct menu *menu)
+static void display_tree(GtkTreeStore *store, struct menu *menu)
 {
-	_display_tree(menu, NULL);
+	_display_tree(store, menu, NULL);
 }
 
 /* Display a part of the tree starting at current node (single/split view) */
@@ -1057,11 +1059,11 @@ static void display_tree_part(void)
 {
 	gtk_tree_store_clear(tree2);
 	if (view_mode == SINGLE_VIEW)
-		display_tree(current);
+		display_tree(tree2, current);
 	else if (view_mode == SPLIT_VIEW)
-		display_tree(browsed);
+		display_tree(tree2, browsed);
 	else if (view_mode == FULL_VIEW)
-		display_tree(&rootmenu);
+		display_tree(tree2, &rootmenu);
 	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w));
 }
 
@@ -1070,10 +1072,8 @@ static void display_list(void)
 {
 	gtk_tree_store_clear(tree1);
 
-	tree = tree1;
-	display_tree(&rootmenu);
+	display_tree(tree1, &rootmenu);
 	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree1_w));
-	tree = tree2;
 }
 
 static void fixup_rootmenu(struct menu *menu)
@@ -1251,7 +1251,7 @@ static void init_main_window(const gchar *glade_file)
 
 static void init_tree_model(void)
 {
-	tree = tree2 = gtk_tree_store_new(COL_NUMBER,
+	tree2 = gtk_tree_store_new(COL_NUMBER,
 					  G_TYPE_STRING, G_TYPE_STRING,
 					  G_TYPE_STRING, G_TYPE_STRING,
 					  G_TYPE_STRING, G_TYPE_STRING,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 42/66] kconfig: gconf: merge 'current' and 'browsed' global variables
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (40 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 41/66] kconfig: gconf: remove global 'tree' variable Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 43/66] kconfig: gconf: preserve menu selection when switching view mode Masahiro Yamada
                   ` (24 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The 'current' (SINGLE view) and 'browsed' (SPLIT_VIEW) variables serve
similar purposes and are not needed at the same time. Merge them.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 32 +++++++++++++-------------------
 1 file changed, 13 insertions(+), 19 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index cfe65baa4f18..cf9345ba23ce 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -46,8 +46,7 @@ static GtkTextTag *tag1, *tag2;
 static GtkTreeStore *tree1, *tree2;
 static GtkTreeModel *model1, *model2;
 
-static struct menu *current; // current node for SINGLE view
-static struct menu *browsed; // browsed node for SPLIT view
+static struct menu *browsed; // browsed menu for SINGLE/SPLIT view
 
 enum {
 	COL_OPTION, COL_NAME, COL_NO, COL_MOD, COL_YES, COL_VALUE,
@@ -90,7 +89,7 @@ static void set_view_mode(enum view_mode mode)
 
 	switch (mode) {
 	case SINGLE_VIEW:
-		current = &rootmenu;
+		browsed = &rootmenu;
 		display_tree_part();
 		gtk_widget_set_sensitive(single_btn, FALSE);
 		break;
@@ -352,13 +351,13 @@ static void on_back_clicked(GtkButton *button, gpointer user_data)
 {
 	enum prop_type ptype;
 
-	current = current->parent;
-	ptype = current->prompt ? current->prompt->type : P_UNKNOWN;
+	browsed = browsed->parent;
+	ptype = browsed->prompt ? browsed->prompt->type : P_UNKNOWN;
 	if (ptype != P_MENU)
-		current = current->parent;
+		browsed = browsed->parent;
 	display_tree_part();
 
-	if (current == &rootmenu)
+	if (browsed == &rootmenu)
 		gtk_widget_set_sensitive(back_btn, FALSE);
 }
 
@@ -611,7 +610,7 @@ static gboolean on_treeview2_button_press_event(GtkWidget *widget,
 
 		if (ptype == P_MENU && view_mode != FULL_VIEW && col == COL_OPTION) {
 			// goes down into menu
-			current = menu;
+			browsed = menu;
 			display_tree_part();
 			gtk_widget_set_sensitive(back_btn, TRUE);
 		} else if (col == COL_OPTION) {
@@ -710,14 +709,11 @@ static gboolean on_treeview1_button_press_event(GtkWidget *widget,
 	gtk_tree_model_get_iter(model, &iter, path);
 	gtk_tree_model_get(model, &iter, COL_MENU, &menu, -1);
 
-	if (event->type == GDK_2BUTTON_PRESS) {
+	if (event->type == GDK_2BUTTON_PRESS)
 		toggle_sym_value(menu);
-		current = menu;
-		display_tree_part();
-	} else {
-		browsed = menu;
-		display_tree_part();
-	}
+
+	browsed = menu;
+	display_tree_part();
 
 	gtk_tree_view_set_cursor(view, path, NULL, FALSE);
 	gtk_widget_grab_focus(tree2_w);
@@ -1011,7 +1007,7 @@ static void _display_tree(GtkTreeStore *tree, struct menu *menu,
 	GtkTreeIter iter;
 
 	if (menu == &rootmenu)
-		current = &rootmenu;
+		browsed = &rootmenu;
 
 	for (child = menu->list; child; child = child->next) {
 		prop = child->prompt;
@@ -1058,9 +1054,7 @@ static void display_tree(GtkTreeStore *store, struct menu *menu)
 static void display_tree_part(void)
 {
 	gtk_tree_store_clear(tree2);
-	if (view_mode == SINGLE_VIEW)
-		display_tree(tree2, current);
-	else if (view_mode == SPLIT_VIEW)
+	if (view_mode == SINGLE_VIEW || view_mode == SPLIT_VIEW)
 		display_tree(tree2, browsed);
 	else if (view_mode == FULL_VIEW)
 		display_tree(tree2, &rootmenu);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 43/66] kconfig: gconf: preserve menu selection when switching view mode
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (41 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 42/66] kconfig: gconf: merge 'current' and 'browsed' global variables Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-30  5:42   ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 44/66] kconfig: gconf: use GtkTreeModelFilter to control row visibility Masahiro Yamada
                   ` (23 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

Preserve the current menu selection when switching to a different view
mode, as it improves usability.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 86 +++++++++++++++++++++++++++++++++++++----
 1 file changed, 78 insertions(+), 8 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index cf9345ba23ce..184678dd4fa6 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -47,6 +47,7 @@ static GtkTreeStore *tree1, *tree2;
 static GtkTreeModel *model1, *model2;
 
 static struct menu *browsed; // browsed menu for SINGLE/SPLIT view
+static struct menu *selected; // selected entry
 
 enum {
 	COL_OPTION, COL_NAME, COL_NO, COL_MOD, COL_YES, COL_VALUE,
@@ -68,6 +69,47 @@ static void conf_changed(bool dirty)
 
 /* Utility Functions */
 
+static void _select_menu(GtkTreeView *view, GtkTreeModel *model,
+			 GtkTreeIter *parent, struct menu *match)
+{
+	GtkTreeIter iter;
+	gboolean valid;
+
+	valid = gtk_tree_model_iter_children(model, &iter, parent);
+	while (valid) {
+		struct menu *menu;
+
+		gtk_tree_model_get(model, &iter, COL_MENU, &menu, -1);
+
+		if (menu == match) {
+			GtkTreeSelection *selection;
+			GtkTreePath *path;
+
+			/*
+			 * Expand parents to reflect the selection, and
+			 * scroll down to it.
+			 */
+			path = gtk_tree_model_get_path(model, &iter);
+			gtk_tree_view_expand_to_path(view, path);
+			gtk_tree_view_scroll_to_cell(view, path, NULL, TRUE,
+						     0.5, 0.0);
+			gtk_tree_path_free(path);
+
+			selection = gtk_tree_view_get_selection(view);
+			gtk_tree_selection_select_iter(selection, &iter);
+		}
+
+		_select_menu(view, model, &iter, match);
+
+		valid = gtk_tree_model_iter_next(model, &iter);
+	}
+}
+
+static void select_menu(GtkTreeView *view, struct menu *match)
+{
+	_select_menu(view, gtk_tree_view_get_model(view), NULL, match);
+}
+
 static void set_view_mode(enum view_mode mode)
 {
 	view_mode = mode;
@@ -89,24 +131,40 @@ static void set_view_mode(enum view_mode mode)
 
 	switch (mode) {
 	case SINGLE_VIEW:
-		browsed = &rootmenu;
+		if (selected)
+			browsed = menu_get_parent_menu(selected) ?: &rootmenu;
+		else
+			browsed = &rootmenu;
 		display_tree_part();
+		select_menu(GTK_TREE_VIEW(tree2_w), selected);
 		gtk_widget_set_sensitive(single_btn, FALSE);
 		break;
 	case SPLIT_VIEW:
+		browsed = NULL;
+		if (selected) {
+			if (selected->type == M_MENU)
+				browsed = selected;
+			else
+				browsed = menu_get_parent_menu(selected);
+		}
 		gtk_tree_store_clear(tree2);
 		display_list();
+		if (browsed)
+			display_tree(tree2, browsed);
+		select_menu(GTK_TREE_VIEW(tree1_w), browsed);
+		select_menu(GTK_TREE_VIEW(tree2_w), selected);
 		gtk_widget_set_sensitive(split_btn, FALSE);
 		break;
 	case FULL_VIEW:
 		gtk_tree_store_clear(tree2);
 		display_tree(tree2, &rootmenu);
+		select_menu(GTK_TREE_VIEW(tree2_w), selected);
 		gtk_widget_set_sensitive(full_btn, FALSE);
 		break;
 	}
 
-	if (mode != SINGLE_VIEW)
-		gtk_widget_set_sensitive(back_btn, FALSE);
+	gtk_widget_set_sensitive(back_btn,
+				 mode == SINGLE_VIEW && browsed != &rootmenu);
 }
 
 static void text_insert_help(struct menu *menu)
@@ -603,6 +661,8 @@ static gboolean on_treeview2_button_press_event(GtkWidget *widget,
 		return FALSE;
 	gtk_tree_model_get(model, &iter, COL_MENU, &menu, -1);
 
+	selected = menu;
+
 	col = column2index(column);
 	if (event->type == GDK_2BUTTON_PRESS) {
 		enum prop_type ptype;
@@ -712,8 +772,12 @@ static gboolean on_treeview1_button_press_event(GtkWidget *widget,
 	if (event->type == GDK_2BUTTON_PRESS)
 		toggle_sym_value(menu);
 
-	browsed = menu;
-	display_tree_part();
+	selected = menu;
+
+	if (menu->type == M_MENU) {
+		browsed = menu;
+		display_tree_part();
+	}
 
 	gtk_tree_view_set_cursor(view, path, NULL, FALSE);
 	gtk_widget_grab_focus(tree2_w);
@@ -1006,10 +1070,16 @@ static void _display_tree(GtkTreeStore *tree, struct menu *menu,
 	enum prop_type ptype;
 	GtkTreeIter iter;
 
-	if (menu == &rootmenu)
-		browsed = &rootmenu;
-
 	for (child = menu->list; child; child = child->next) {
+		/*
+		 * REVISIT:
+		 * menu_finalize() creates empty "if" entries.
+		 * Do not confuse gtk_tree_model_get(), which would otherwise
+		 * return "if" menu entry.
+		 */
+		if (child->type == M_IF)
+			continue;
+
 		prop = child->prompt;
 		ptype = prop ? prop->type : P_UNKNOWN;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 44/66] kconfig: gconf: use GtkTreeModelFilter to control row visibility
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (42 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 43/66] kconfig: gconf: preserve menu selection when switching view mode Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 45/66] kconfig: gconf: remove global 'model1' and 'model2' variables Masahiro Yamada
                   ` (22 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

Currently, update_tree() adds/removes entries to show/hide rows.
This approach is extremely complicated.

Use the tree model filter to control row visibility instead.

Do not toggle the MENU_CHANGED flag, as it is hard to control
this correctly.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 217 +++++++++++++++-------------------------
 1 file changed, 80 insertions(+), 137 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 184678dd4fa6..a0cc7cb98670 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -59,7 +59,9 @@ enum {
 static void display_list(void);
 static void display_tree(GtkTreeStore *store, struct menu *menu);
 static void display_tree_part(void);
-static void update_tree(struct menu *src, GtkTreeIter * dst);
+static gchar **fill_row(struct menu *menu);
+static void set_node(GtkTreeStore *tree, GtkTreeIter *node,
+		     struct menu *menu, gchar **row);
 
 static void conf_changed(bool dirty)
 {
@@ -110,6 +112,47 @@ static void select_menu(GtkTreeView *view, struct menu *match)
 	_select_menu(view, gtk_tree_view_get_model(view), NULL, match);
 }
 
+static void _update_row_visibility(GtkTreeView *view)
+{
+	GtkTreeModelFilter *filter = GTK_TREE_MODEL_FILTER(gtk_tree_view_get_model(view));
+
+	gtk_tree_model_filter_refilter(filter);
+}
+
+static void update_row_visibility(void)
+{
+	if (view_mode == SPLIT_VIEW)
+		_update_row_visibility(GTK_TREE_VIEW(tree1_w));
+	_update_row_visibility(GTK_TREE_VIEW(tree2_w));
+}
+
+static void _update_tree(GtkTreeStore *store, GtkTreeIter *parent)
+{
+	GtkTreeModel *model = GTK_TREE_MODEL(store);
+	GtkTreeIter iter;
+	gboolean valid;
+
+	valid = gtk_tree_model_iter_children(model, &iter, parent);
+	while (valid) {
+		struct menu *menu;
+
+		gtk_tree_model_get(model, &iter, COL_MENU, &menu, -1);
+
+		if (menu)
+			set_node(store, &iter, menu, fill_row(menu));
+
+		_update_tree(store, &iter);
+
+		valid = gtk_tree_model_iter_next(model, &iter);
+	}
+}
+
+static void update_tree(GtkTreeStore *store)
+{
+	_update_tree(store, NULL);
+	update_row_visibility();
+}
+
 static void set_view_mode(enum view_mode mode)
 {
 	view_mode = mode;
@@ -328,24 +371,21 @@ static void on_set_option_mode1_activate(GtkMenuItem *menuitem,
 					 gpointer user_data)
 {
 	opt_mode = OPT_NORMAL;
-	gtk_tree_store_clear(tree2);
-	display_tree(tree2, &rootmenu);	/* instead of update_tree to speed-up */
+	update_row_visibility();
 }
 
 static void on_set_option_mode2_activate(GtkMenuItem *menuitem,
 					 gpointer user_data)
 {
 	opt_mode = OPT_ALL;
-	gtk_tree_store_clear(tree2);
-	display_tree(tree2, &rootmenu);	/* instead of update_tree to speed-up */
+	update_row_visibility();
 }
 
 static void on_set_option_mode3_activate(GtkMenuItem *menuitem,
 					 gpointer user_data)
 {
 	opt_mode = OPT_PROMPT;
-	gtk_tree_store_clear(tree2);
-	display_tree(tree2, &rootmenu);	/* instead of update_tree to speed-up */
+	update_row_visibility();
 }
 
 static void on_introduction1_activate(GtkMenuItem *menuitem, gpointer user_data)
@@ -559,7 +599,7 @@ static void renderer_edited(GtkCellRendererText * cell,
 
 	sym_set_string_value(sym, new_def);
 
-	update_tree(&rootmenu, NULL);
+	update_tree(tree2);
 
 free:
 	gtk_tree_path_free(path);
@@ -590,9 +630,9 @@ static void change_sym_value(struct menu *menu, gint col)
 			newval = yes;
 		sym_set_tristate_value(sym, newval);
 		if (view_mode == FULL_VIEW)
-			update_tree(&rootmenu, NULL);
+			update_tree(tree2);
 		else if (view_mode == SPLIT_VIEW) {
-			update_tree(browsed, NULL);
+			update_tree(tree2);
 			display_list();
 		}
 		else if (view_mode == SINGLE_VIEW)
@@ -613,9 +653,9 @@ static void toggle_sym_value(struct menu *menu)
 
 	sym_toggle_tristate_value(menu->sym);
 	if (view_mode == FULL_VIEW)
-		update_tree(&rootmenu, NULL);
+		update_tree(tree2);
 	else if (view_mode == SPLIT_VIEW) {
-		update_tree(browsed, NULL);
+		update_tree(tree2);
 		display_list();
 	}
 	else if (view_mode == SINGLE_VIEW)
@@ -842,7 +882,6 @@ static gchar **fill_row(struct menu *menu)
 	row[COL_NAME] = g_strdup(sym->name);
 
 	sym_calc_value(sym);
-	menu->flags &= ~MENU_CHANGED;
 
 	if (sym_is_choice(sym)) {	// parse childs for getting final value
 		struct menu *child;
@@ -947,120 +986,6 @@ static void set_node(GtkTreeStore *tree, GtkTreeIter *node,
 	g_object_unref(pix);
 }
 
-/* Find a node in the GTK+ tree */
-static GtkTreeIter found;
-
-/*
- * Find a menu in the GtkTree starting at parent.
- */
-static GtkTreeIter *gtktree_iter_find_node(GtkTreeIter *parent,
-					   struct menu *tofind)
-{
-	GtkTreeIter iter;
-	GtkTreeIter *child = &iter;
-	gboolean valid;
-	GtkTreeIter *ret;
-
-	valid = gtk_tree_model_iter_children(model2, child, parent);
-	while (valid) {
-		struct menu *menu;
-
-		gtk_tree_model_get(model2, child, 6, &menu, -1);
-
-		if (menu == tofind) {
-			memcpy(&found, child, sizeof(GtkTreeIter));
-			return &found;
-		}
-
-		ret = gtktree_iter_find_node(child, tofind);
-		if (ret)
-			return ret;
-
-		valid = gtk_tree_model_iter_next(model2, child);
-	}
-
-	return NULL;
-}
-
-
-/*
- * Update the tree by adding/removing entries
- * Does not change other nodes
- */
-static void update_tree(struct menu *src, GtkTreeIter * dst)
-{
-	struct menu *child1;
-	GtkTreeIter iter, tmp;
-	GtkTreeIter *child2 = &iter;
-	gboolean valid;
-	GtkTreeIter *sibling;
-	struct symbol *sym;
-	struct menu *menu1, *menu2;
-
-	valid = gtk_tree_model_iter_children(model2, child2, dst);
-	for (child1 = src->list; child1; child1 = child1->next) {
-
-		sym = child1->sym;
-
-	      reparse:
-		menu1 = child1;
-		if (valid)
-			gtk_tree_model_get(model2, child2, COL_MENU,
-					   &menu2, -1);
-		else
-			menu2 = NULL;	// force adding of a first child
-
-		if ((opt_mode == OPT_NORMAL && !menu_is_visible(child1)) ||
-		    (opt_mode == OPT_PROMPT && !menu_has_prompt(child1)) ||
-		    (opt_mode == OPT_ALL    && !menu_get_prompt(child1))) {
-
-			/* remove node */
-			if (gtktree_iter_find_node(dst, menu1) != NULL) {
-				memcpy(&tmp, child2, sizeof(GtkTreeIter));
-				valid = gtk_tree_model_iter_next(model2,
-								 child2);
-				gtk_tree_store_remove(tree2, &tmp);
-				if (!valid)
-					return;		/* next parent */
-				else
-					goto reparse;	/* next child */
-			} else
-				continue;
-		}
-
-		if (menu1 != menu2) {
-			if (gtktree_iter_find_node(dst, menu1) == NULL) {	// add node
-				if (!valid && !menu2)
-					sibling = NULL;
-				else
-					sibling = child2;
-				gtk_tree_store_insert_before(tree2,
-							     child2,
-							     dst, sibling);
-				set_node(tree2, child2, menu1, fill_row(menu1));
-				if (menu2 == NULL)
-					valid = TRUE;
-			} else {	// remove node
-				memcpy(&tmp, child2, sizeof(GtkTreeIter));
-				valid = gtk_tree_model_iter_next(model2,
-								 child2);
-				gtk_tree_store_remove(tree2, &tmp);
-				if (!valid)
-					return;	// next parent
-				else
-					goto reparse;	// next child
-			}
-		} else if (sym && (child1->flags & MENU_CHANGED)) {
-			set_node(tree2, child2, menu1, fill_row(menu1));
-		}
-
-		update_tree(child1, child2);
-
-		valid = gtk_tree_model_iter_next(model2, child2);
-	}
-}
-
-
 /* Display the whole tree (single/split/full view) */
 static void _display_tree(GtkTreeStore *tree, struct menu *menu,
 			  GtkTreeIter *parent)
@@ -1083,8 +1008,6 @@ static void _display_tree(GtkTreeStore *tree, struct menu *menu,
 		prop = child->prompt;
 		ptype = prop ? prop->type : P_UNKNOWN;
 
-		menu->flags &= ~MENU_CHANGED;
-
 		if ((view_mode == SPLIT_VIEW)
 		    && !(child->flags & MENU_ROOT) && (tree == tree1))
 			continue;
@@ -1093,12 +1016,8 @@ static void _display_tree(GtkTreeStore *tree, struct menu *menu,
 		    && (tree == tree2))
 			continue;
 
-		if ((opt_mode == OPT_NORMAL && menu_is_visible(child)) ||
-		    (opt_mode == OPT_PROMPT && menu_has_prompt(child)) ||
-		    (opt_mode == OPT_ALL    && menu_get_prompt(child))) {
-			gtk_tree_store_append(tree, &iter, parent);
-			set_node(tree, &iter, child, fill_row(child));
-		}
+		gtk_tree_store_append(tree, &iter, parent);
+		set_node(tree, &iter, child, fill_row(child));
 
 		if ((view_mode != FULL_VIEW) && (ptype == P_MENU)
 		    && (tree == tree2))
@@ -1313,6 +1232,20 @@ static void init_main_window(const gchar *glade_file)
 	gtk_widget_show(main_wnd);
 }
 
+static gboolean visible_func(GtkTreeModel *model, GtkTreeIter  *iter,
+			     gpointer data)
+{
+	struct menu *menu;
+
+	gtk_tree_model_get(model, iter, COL_MENU, &menu, -1);
+
+	if (!menu)
+		return FALSE;
+
+	return menu_is_visible(menu) || opt_mode == OPT_ALL ||
+		(opt_mode == OPT_PROMPT && menu_has_prompt(menu));
+}
+
 static void init_tree_model(void)
 {
 	tree2 = gtk_tree_store_new(COL_NUMBER,
@@ -1344,8 +1277,13 @@ static void init_left_tree(void)
 	GtkCellRenderer *renderer;
 	GtkTreeSelection *sel;
 	GtkTreeViewColumn *column;
+	GtkTreeModel *filter;
 
-	gtk_tree_view_set_model(view, model1);
+	filter = gtk_tree_model_filter_new(model1, NULL);
+
+	gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(filter),
+					       visible_func, NULL, NULL);
+	gtk_tree_view_set_model(view, filter);
 
 	column = gtk_tree_view_column_new();
 	gtk_tree_view_append_column(view, column);
@@ -1379,9 +1317,14 @@ static void init_right_tree(void)
 	GtkCellRenderer *renderer;
 	GtkTreeSelection *sel;
 	GtkTreeViewColumn *column;
+	GtkTreeModel *filter;
 	gint i;
 
-	gtk_tree_view_set_model(view, model2);
+	filter = gtk_tree_model_filter_new(model2, NULL);
+
+	gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(filter),
+					       visible_func, NULL, NULL);
+	gtk_tree_view_set_model(view, filter);
 
 	column = gtk_tree_view_column_new();
 	gtk_tree_view_append_column(view, column);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 45/66] kconfig: gconf: remove global 'model1' and 'model2' variables
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (43 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 44/66] kconfig: gconf: use GtkTreeModelFilter to control row visibility Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-30  4:10   ` Randy Dunlap
  2025-06-24 15:05 ` [PATCH 46/66] kconfig: gconf: remove init_tree_model() Masahiro Yamada
                   ` (21 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

These variables are unnecessary because the current model can be
retrieved using gtk_tree_view_get_model().

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index a0cc7cb98670..32cf6ae0e5f2 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -44,7 +44,6 @@ static GtkWidget *save_menu_item;
 static GtkTextTag *tag1, *tag2;
 
 static GtkTreeStore *tree1, *tree2;
-static GtkTreeModel *model1, *model2;
 
 static struct menu *browsed; // browsed menu for SINGLE/SPLIT view
 static struct menu *selected; // selected entry
@@ -1257,7 +1256,6 @@ static void init_tree_model(void)
 					  G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
 					  G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
 					  G_TYPE_BOOLEAN);
-	model2 = GTK_TREE_MODEL(tree2);
 
 	tree1 = gtk_tree_store_new(COL_NUMBER,
 				   G_TYPE_STRING, G_TYPE_STRING,
@@ -1268,7 +1266,6 @@ static void init_tree_model(void)
 				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
 				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
 				   G_TYPE_BOOLEAN);
-	model1 = GTK_TREE_MODEL(tree1);
 }
 
 static void init_left_tree(void)
@@ -1279,7 +1276,7 @@ static void init_left_tree(void)
 	GtkTreeViewColumn *column;
 	GtkTreeModel *filter;
 
-	filter = gtk_tree_model_filter_new(model1, NULL);
+	filter = gtk_tree_model_filter_new(GTK_TREE_MODEL(tree1), NULL);
 
 	gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(filter),
 					       visible_func, NULL, NULL);
@@ -1320,7 +1317,7 @@ static void init_right_tree(void)
 	GtkTreeModel *filter;
 	gint i;
 
-	filter = gtk_tree_model_filter_new(model2, NULL);
+	filter = gtk_tree_model_filter_new(GTK_TREE_MODEL(tree2), NULL);
 
 	gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(filter),
 					       visible_func, NULL, NULL);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 46/66] kconfig: gconf: remove init_tree_model()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (44 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 45/66] kconfig: gconf: remove global 'model1' and 'model2' variables Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 47/66] kconfig: gconf: inline fill_row() into set_node() Masahiro Yamada
                   ` (20 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

Move the relevant code into init_left_tree() or init_right_tree().

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 32cf6ae0e5f2..0977d906bea6 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -1245,17 +1245,13 @@ static gboolean visible_func(GtkTreeModel *model, GtkTreeIter  *iter,
 		(opt_mode == OPT_PROMPT && menu_has_prompt(menu));
 }
 
-static void init_tree_model(void)
+static void init_left_tree(void)
 {
-	tree2 = gtk_tree_store_new(COL_NUMBER,
-					  G_TYPE_STRING, G_TYPE_STRING,
-					  G_TYPE_STRING, G_TYPE_STRING,
-					  G_TYPE_STRING, G_TYPE_STRING,
-					  G_TYPE_POINTER, GDK_TYPE_COLOR,
-					  G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF,
-					  G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
-					  G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
-					  G_TYPE_BOOLEAN);
+	GtkTreeView *view = GTK_TREE_VIEW(tree1_w);
+	GtkCellRenderer *renderer;
+	GtkTreeSelection *sel;
+	GtkTreeViewColumn *column;
+	GtkTreeModel *filter;
 
 	tree1 = gtk_tree_store_new(COL_NUMBER,
 				   G_TYPE_STRING, G_TYPE_STRING,
@@ -1266,15 +1262,6 @@ static void init_tree_model(void)
 				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
 				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
 				   G_TYPE_BOOLEAN);
-}
-
-static void init_left_tree(void)
-{
-	GtkTreeView *view = GTK_TREE_VIEW(tree1_w);
-	GtkCellRenderer *renderer;
-	GtkTreeSelection *sel;
-	GtkTreeViewColumn *column;
-	GtkTreeModel *filter;
 
 	filter = gtk_tree_model_filter_new(GTK_TREE_MODEL(tree1), NULL);
 
@@ -1317,6 +1304,16 @@ static void init_right_tree(void)
 	GtkTreeModel *filter;
 	gint i;
 
+	tree2 = gtk_tree_store_new(COL_NUMBER,
+				   G_TYPE_STRING, G_TYPE_STRING,
+				   G_TYPE_STRING, G_TYPE_STRING,
+				   G_TYPE_STRING, G_TYPE_STRING,
+				   G_TYPE_POINTER, GDK_TYPE_COLOR,
+				   G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF,
+				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
+				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
+				   G_TYPE_BOOLEAN);
+
 	filter = gtk_tree_model_filter_new(GTK_TREE_MODEL(tree2), NULL);
 
 	gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(filter),
@@ -1439,7 +1436,6 @@ int main(int ac, char *av[])
 
 	/* Load the interface and connect signals */
 	init_main_window(glade_file);
-	init_tree_model();
 	init_left_tree();
 	init_right_tree();
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 47/66] kconfig: gconf: inline fill_row() into set_node()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (45 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 46/66] kconfig: gconf: remove init_tree_model() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 48/66] kconfig: gconf: do not reconstruct tree store when a symbol is changed Masahiro Yamada
                   ` (19 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The row[] array is used to prepare data passed to set_node(), but this
indirection is unnecessary. Squash fill_row() into set_node() and call
gtk_tree_store_set() directly.

Also, calling gdk_pixbuf_new_from_xpm_data() for every row is
inefficient. Call it once and store the resulting pixbuf in a global
variable.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 272 ++++++++++++++++------------------------
 1 file changed, 106 insertions(+), 166 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 0977d906bea6..0b73ba9eca14 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -44,6 +44,7 @@ static GtkWidget *save_menu_item;
 static GtkTextTag *tag1, *tag2;
 
 static GtkTreeStore *tree1, *tree2;
+static GdkPixbuf *pix_menu;
 
 static struct menu *browsed; // browsed menu for SINGLE/SPLIT view
 static struct menu *selected; // selected entry
@@ -58,9 +59,6 @@ enum {
 static void display_list(void);
 static void display_tree(GtkTreeStore *store, struct menu *menu);
 static void display_tree_part(void);
-static gchar **fill_row(struct menu *menu);
-static void set_node(GtkTreeStore *tree, GtkTreeIter *node,
-		     struct menu *menu, gchar **row);
 
 static void conf_changed(bool dirty)
 {
@@ -125,6 +123,104 @@ static void update_row_visibility(void)
 	_update_row_visibility(GTK_TREE_VIEW(tree2_w));
 }
 
+static void set_node(GtkTreeStore *tree, GtkTreeIter *node, struct menu *menu)
+{
+	struct symbol *sym = menu->sym;
+	tristate val;
+	gchar *option;
+	const gchar *_no = "";
+	const gchar *_mod = "";
+	const gchar *_yes = "";
+	const gchar *value = "";
+	GdkColor color;
+	gboolean editable = FALSE;
+	gboolean btnvis = FALSE;
+
+	option = g_strdup_printf("%s %s %s %s",
+				 menu->type == M_COMMENT ? "***" : "",
+				 menu_get_prompt(menu),
+				 menu->type == M_COMMENT ? "***" : "",
+				 sym && !sym_has_value(sym) ? "(NEW)" : "");
+
+	gdk_color_parse(menu_is_visible(menu) ? "Black" : "DarkGray", &color);
+
+	if (!sym)
+		goto set;
+
+	sym_calc_value(sym);
+
+	if (menu->type == M_CHOICE) {	// parse children to get a final value
+		struct symbol *def_sym = sym_calc_choice(menu);
+		struct menu *def_menu = NULL;
+
+		for (struct menu *child = menu->list; child; child = child->next) {
+			if (menu_is_visible(child) && child->sym == def_sym)
+				def_menu = child;
+		}
+
+		if (def_menu)
+			value = menu_get_prompt(def_menu);
+
+		goto set;
+	}
+
+	switch (sym_get_type(sym)) {
+	case S_BOOLEAN:
+	case S_TRISTATE:
+
+		btnvis = TRUE;
+
+		val = sym_get_tristate_value(sym);
+		switch (val) {
+		case no:
+			_no = "N";
+			value = "N";
+			break;
+		case mod:
+			_mod = "M";
+			value = "M";
+			break;
+		case yes:
+			_yes = "Y";
+			value = "Y";
+			break;
+		}
+
+		if (val != no && sym_tristate_within_range(sym, no))
+			_no = "_";
+		if (val != mod && sym_tristate_within_range(sym, mod))
+			_mod = "_";
+		if (val != yes && sym_tristate_within_range(sym, yes))
+			_yes = "_";
+		break;
+	default:
+		value = sym_get_string_value(sym);
+		editable = TRUE;
+		break;
+	}
+
+set:
+	gtk_tree_store_set(tree, node,
+			   COL_OPTION, option,
+			   COL_NAME, sym ? sym->name : "",
+			   COL_NO, _no,
+			   COL_MOD, _mod,
+			   COL_YES, _yes,
+			   COL_VALUE, value,
+			   COL_MENU, (gpointer) menu,
+			   COL_COLOR, &color,
+			   COL_EDIT, editable,
+			   COL_PIXBUF, pix_menu,
+			   COL_PIXVIS, view_mode == SINGLE_VIEW && menu->type == M_MENU,
+			   COL_BTNVIS, btnvis,
+			   COL_BTNACT, _yes[0] == 'Y',
+			   COL_BTNINC, _mod[0] == 'M',
+			   COL_BTNRAD, sym && sym_is_choice_value(sym),
+			   -1);
+
+	g_free(option);
+}
+
 static void _update_tree(GtkTreeStore *store, GtkTreeIter *parent)
 {
 	GtkTreeModel *model = GTK_TREE_MODEL(store);
@@ -138,7 +234,7 @@ static void _update_tree(GtkTreeStore *store, GtkTreeIter *parent)
 		gtk_tree_model_get(model, &iter, COL_MENU, &menu, -1);
 
 		if (menu)
-			set_node(store, &iter, menu, fill_row(menu));
+			set_node(store, &iter, menu);
 
 		_update_tree(store, &iter);
 
@@ -563,6 +659,9 @@ static gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
 
 	gtk_widget_destroy(dialog);
 
+	if (!ret)
+		g_object_unref(pix_menu);
+
 	return ret;
 }
 
@@ -824,167 +923,6 @@ static gboolean on_treeview1_button_press_event(GtkWidget *widget,
 	return FALSE;
 }
 
-
-/* Fill a row of strings */
-static gchar **fill_row(struct menu *menu)
-{
-	static gchar *row[COL_NUMBER];
-	struct symbol *sym = menu->sym;
-	const char *def;
-	int stype;
-	tristate val;
-	enum prop_type ptype;
-	int i;
-
-	for (i = COL_OPTION; i <= COL_COLOR; i++)
-		g_free(row[i]);
-	bzero(row, sizeof(row));
-
-	ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN;
-
-	row[COL_OPTION] =
-	    g_strdup_printf("%s %s %s %s",
-			    ptype == P_COMMENT ? "***" : "",
-			    menu_get_prompt(menu),
-			    ptype == P_COMMENT ? "***" : "",
-			    sym && !sym_has_value(sym) ? "(NEW)" : "");
-
-	if (opt_mode == OPT_ALL && !menu_is_visible(menu))
-		row[COL_COLOR] = g_strdup("DarkGray");
-	else if (opt_mode == OPT_PROMPT &&
-			menu_has_prompt(menu) && !menu_is_visible(menu))
-		row[COL_COLOR] = g_strdup("DarkGray");
-	else
-		row[COL_COLOR] = g_strdup("Black");
-
-	switch (ptype) {
-	case P_MENU:
-		row[COL_PIXBUF] = (gchar *) xpm_menu;
-		if (view_mode == SINGLE_VIEW)
-			row[COL_PIXVIS] = GINT_TO_POINTER(TRUE);
-		row[COL_BTNVIS] = GINT_TO_POINTER(FALSE);
-		break;
-	case P_COMMENT:
-		row[COL_PIXBUF] = (gchar *) xpm_void;
-		row[COL_PIXVIS] = GINT_TO_POINTER(FALSE);
-		row[COL_BTNVIS] = GINT_TO_POINTER(FALSE);
-		break;
-	default:
-		row[COL_PIXBUF] = (gchar *) xpm_void;
-		row[COL_PIXVIS] = GINT_TO_POINTER(FALSE);
-		row[COL_BTNVIS] = GINT_TO_POINTER(TRUE);
-		break;
-	}
-
-	if (!sym)
-		return row;
-	row[COL_NAME] = g_strdup(sym->name);
-
-	sym_calc_value(sym);
-
-	if (sym_is_choice(sym)) {	// parse childs for getting final value
-		struct menu *child;
-		struct symbol *def_sym = sym_calc_choice(menu);
-		struct menu *def_menu = NULL;
-
-		for (child = menu->list; child; child = child->next) {
-			if (menu_is_visible(child)
-			    && child->sym == def_sym)
-				def_menu = child;
-		}
-
-		if (def_menu)
-			row[COL_VALUE] =
-			    g_strdup(menu_get_prompt(def_menu));
-
-		row[COL_BTNVIS] = GINT_TO_POINTER(FALSE);
-		return row;
-	}
-	if (sym_is_choice_value(sym))
-		row[COL_BTNRAD] = GINT_TO_POINTER(TRUE);
-
-	stype = sym_get_type(sym);
-	switch (stype) {
-	case S_BOOLEAN:
-	case S_TRISTATE:
-		val = sym_get_tristate_value(sym);
-		switch (val) {
-		case no:
-			row[COL_NO] = g_strdup("N");
-			row[COL_VALUE] = g_strdup("N");
-			row[COL_BTNACT] = GINT_TO_POINTER(FALSE);
-			row[COL_BTNINC] = GINT_TO_POINTER(FALSE);
-			break;
-		case mod:
-			row[COL_MOD] = g_strdup("M");
-			row[COL_VALUE] = g_strdup("M");
-			row[COL_BTNINC] = GINT_TO_POINTER(TRUE);
-			break;
-		case yes:
-			row[COL_YES] = g_strdup("Y");
-			row[COL_VALUE] = g_strdup("Y");
-			row[COL_BTNACT] = GINT_TO_POINTER(TRUE);
-			row[COL_BTNINC] = GINT_TO_POINTER(FALSE);
-			break;
-		}
-
-		if (val != no && sym_tristate_within_range(sym, no))
-			row[COL_NO] = g_strdup("_");
-		if (val != mod && sym_tristate_within_range(sym, mod))
-			row[COL_MOD] = g_strdup("_");
-		if (val != yes && sym_tristate_within_range(sym, yes))
-			row[COL_YES] = g_strdup("_");
-		break;
-	case S_INT:
-	case S_HEX:
-	case S_STRING:
-		def = sym_get_string_value(sym);
-		row[COL_VALUE] = g_strdup(def);
-		row[COL_EDIT] = GINT_TO_POINTER(TRUE);
-		row[COL_BTNVIS] = GINT_TO_POINTER(FALSE);
-		break;
-	}
-
-	return row;
-}
-
-
-/* Set the node content with a row of strings */
-static void set_node(GtkTreeStore *tree, GtkTreeIter *node,
-		     struct menu *menu, gchar **row)
-{
-	GdkColor color;
-	gboolean success;
-	GdkPixbuf *pix;
-
-	pix = gdk_pixbuf_new_from_xpm_data((const char **)
-					   row[COL_PIXBUF]);
-
-	gdk_color_parse(row[COL_COLOR], &color);
-	gdk_colormap_alloc_colors(gdk_colormap_get_system(), &color, 1,
-				  FALSE, FALSE, &success);
-
-	gtk_tree_store_set(tree, node,
-			   COL_OPTION, row[COL_OPTION],
-			   COL_NAME, row[COL_NAME],
-			   COL_NO, row[COL_NO],
-			   COL_MOD, row[COL_MOD],
-			   COL_YES, row[COL_YES],
-			   COL_VALUE, row[COL_VALUE],
-			   COL_MENU, (gpointer) menu,
-			   COL_COLOR, &color,
-			   COL_EDIT, GPOINTER_TO_INT(row[COL_EDIT]),
-			   COL_PIXBUF, pix,
-			   COL_PIXVIS, GPOINTER_TO_INT(row[COL_PIXVIS]),
-			   COL_BTNVIS, GPOINTER_TO_INT(row[COL_BTNVIS]),
-			   COL_BTNACT, GPOINTER_TO_INT(row[COL_BTNACT]),
-			   COL_BTNINC, GPOINTER_TO_INT(row[COL_BTNINC]),
-			   COL_BTNRAD, GPOINTER_TO_INT(row[COL_BTNRAD]),
-			   -1);
-
-	g_object_unref(pix);
-}
-
 /* Display the whole tree (single/split/full view) */
 static void _display_tree(GtkTreeStore *tree, struct menu *menu,
 			  GtkTreeIter *parent)
@@ -1016,7 +954,7 @@ static void _display_tree(GtkTreeStore *tree, struct menu *menu,
 			continue;
 
 		gtk_tree_store_append(tree, &iter, parent);
-		set_node(tree, &iter, child, fill_row(child));
+		set_node(tree, &iter, child);
 
 		if ((view_mode != FULL_VIEW) && (ptype == P_MENU)
 		    && (tree == tree2))
@@ -1384,6 +1322,8 @@ static void init_right_tree(void)
 	g_signal_connect(G_OBJECT(renderer), "edited",
 			 G_CALLBACK(renderer_edited), tree2_w);
 
+	pix_menu = gdk_pixbuf_new_from_xpm_data((const char **)xpm_menu);
+
 	for (i = 0; i < COL_VALUE; i++) {
 		column = gtk_tree_view_get_column(view, i);
 		gtk_tree_view_column_set_resizable(column, TRUE);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 48/66] kconfig: gconf: do not reconstruct tree store when a symbol is changed
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (46 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 47/66] kconfig: gconf: inline fill_row() into set_node() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 49/66] kconfig: gconf: inline display_list() into set_view_mode() Masahiro Yamada
                   ` (18 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

There is no need to reconstruct the entire tree store when a symbol's
value changes. Simply call gtk_tree_store_set() to update the row data.

Introduce update_trees() to factor out the common update logic.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 29 +++++++++++------------------
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 0b73ba9eca14..a358589535e3 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -248,6 +248,13 @@ static void update_tree(GtkTreeStore *store)
 	update_row_visibility();
 }
 
+static void update_trees(void)
+{
+	if (view_mode == SPLIT_VIEW)
+		update_tree(tree1);
+	update_tree(tree2);
+}
+
 static void set_view_mode(enum view_mode mode)
 {
 	view_mode = mode;
@@ -378,7 +385,7 @@ static void on_load1_activate(GtkMenuItem *menuitem, gpointer user_data)
 			text_insert_msg("Error",
 					"Unable to load configuration!");
 		else
-			display_tree_part();
+			update_trees();
 
 		g_free(filename);
 	}
@@ -697,7 +704,7 @@ static void renderer_edited(GtkCellRendererText * cell,
 
 	sym_set_string_value(sym, new_def);
 
-	update_tree(tree2);
+	update_trees();
 
 free:
 	gtk_tree_path_free(path);
@@ -727,14 +734,7 @@ static void change_sym_value(struct menu *menu, gint col)
 		if (!sym_tristate_within_range(sym, newval))
 			newval = yes;
 		sym_set_tristate_value(sym, newval);
-		if (view_mode == FULL_VIEW)
-			update_tree(tree2);
-		else if (view_mode == SPLIT_VIEW) {
-			update_tree(tree2);
-			display_list();
-		}
-		else if (view_mode == SINGLE_VIEW)
-			display_tree_part();	//fixme: keep exp/coll
+		update_trees();
 		break;
 	case S_INT:
 	case S_HEX:
@@ -750,14 +750,7 @@ static void toggle_sym_value(struct menu *menu)
 		return;
 
 	sym_toggle_tristate_value(menu->sym);
-	if (view_mode == FULL_VIEW)
-		update_tree(tree2);
-	else if (view_mode == SPLIT_VIEW) {
-		update_tree(tree2);
-		display_list();
-	}
-	else if (view_mode == SINGLE_VIEW)
-		display_tree_part();	//fixme: keep exp/coll
+	update_trees();
 }
 
 static gint column2index(GtkTreeViewColumn * column)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 49/66] kconfig: gconf: inline display_list() into set_view_mode()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (47 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 48/66] kconfig: gconf: do not reconstruct tree store when a symbol is changed Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 50/66] kconfig: gconf: remove dead code in display_tree_part() Masahiro Yamada
                   ` (17 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This function is now only called by set_view_mode(), so inline it
for simplicity.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index a358589535e3..29b73f0bea38 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -56,7 +56,6 @@ enum {
 	COL_NUMBER
 };
 
-static void display_list(void);
 static void display_tree(GtkTreeStore *store, struct menu *menu);
 static void display_tree_part(void);
 
@@ -292,8 +291,10 @@ static void set_view_mode(enum view_mode mode)
 			else
 				browsed = menu_get_parent_menu(selected);
 		}
+		gtk_tree_store_clear(tree1);
+		display_tree(tree1, &rootmenu);
+		gtk_tree_view_expand_all(GTK_TREE_VIEW(tree1_w));
 		gtk_tree_store_clear(tree2);
-		display_list();
 		if (browsed)
 			display_tree(tree2, browsed);
 		select_menu(GTK_TREE_VIEW(tree1_w), browsed);
@@ -980,15 +981,6 @@ static void display_tree_part(void)
 	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w));
 }
 
-/* Display the list in the left frame (split view) */
-static void display_list(void)
-{
-	gtk_tree_store_clear(tree1);
-
-	display_tree(tree1, &rootmenu);
-	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree1_w));
-}
-
 static void fixup_rootmenu(struct menu *menu)
 {
 	struct menu *child;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 50/66] kconfig: gconf: remove dead code in display_tree_part()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (48 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 49/66] kconfig: gconf: inline display_list() into set_view_mode() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 51/66] kconfig: gconf: rename display_tree_part() Masahiro Yamada
                   ` (16 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This function is no longer called in the FULL_VIEW mode, so remove the
dead code.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 29b73f0bea38..64defbe59afc 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -974,10 +974,7 @@ static void display_tree(GtkTreeStore *store, struct menu *menu)
 static void display_tree_part(void)
 {
 	gtk_tree_store_clear(tree2);
-	if (view_mode == SINGLE_VIEW || view_mode == SPLIT_VIEW)
-		display_tree(tree2, browsed);
-	else if (view_mode == FULL_VIEW)
-		display_tree(tree2, &rootmenu);
+	display_tree(tree2, browsed);
 	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w));
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 51/66] kconfig: gconf: rename display_tree_part()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (49 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 50/66] kconfig: gconf: remove dead code in display_tree_part() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 52/66] kconfig: gconf: remove fixup_rootmenu() Masahiro Yamada
                   ` (15 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This function recreates the tree store to update the menu content.
Rename it to recreate_menu_content_tree() to better reflect its purpose.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 64defbe59afc..23a6f99d2cd4 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -57,7 +57,7 @@ enum {
 };
 
 static void display_tree(GtkTreeStore *store, struct menu *menu);
-static void display_tree_part(void);
+static void recreate_menu_content_tree(void);
 
 static void conf_changed(bool dirty)
 {
@@ -279,7 +279,7 @@ static void set_view_mode(enum view_mode mode)
 			browsed = menu_get_parent_menu(selected) ?: &rootmenu;
 		else
 			browsed = &rootmenu;
-		display_tree_part();
+		recreate_menu_content_tree();
 		select_menu(GTK_TREE_VIEW(tree2_w), selected);
 		gtk_widget_set_sensitive(single_btn, FALSE);
 		break;
@@ -556,7 +556,7 @@ static void on_back_clicked(GtkButton *button, gpointer user_data)
 	ptype = browsed->prompt ? browsed->prompt->type : P_UNKNOWN;
 	if (ptype != P_MENU)
 		browsed = browsed->parent;
-	display_tree_part();
+	recreate_menu_content_tree();
 
 	if (browsed == &rootmenu)
 		gtk_widget_set_sensitive(back_btn, FALSE);
@@ -803,7 +803,7 @@ static gboolean on_treeview2_button_press_event(GtkWidget *widget,
 		if (ptype == P_MENU && view_mode != FULL_VIEW && col == COL_OPTION) {
 			// goes down into menu
 			browsed = menu;
-			display_tree_part();
+			recreate_menu_content_tree();
 			gtk_widget_set_sensitive(back_btn, TRUE);
 		} else if (col == COL_OPTION) {
 			toggle_sym_value(menu);
@@ -908,7 +908,7 @@ static gboolean on_treeview1_button_press_event(GtkWidget *widget,
 
 	if (menu->type == M_MENU) {
 		browsed = menu;
-		display_tree_part();
+		recreate_menu_content_tree();
 	}
 
 	gtk_tree_view_set_cursor(view, path, NULL, FALSE);
@@ -971,7 +971,7 @@ static void display_tree(GtkTreeStore *store, struct menu *menu)
 }
 
 /* Display a part of the tree starting at current node (single/split view) */
-static void display_tree_part(void)
+static void recreate_menu_content_tree(void)
 {
 	gtk_tree_store_clear(tree2);
 	display_tree(tree2, browsed);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 52/66] kconfig: gconf: remove fixup_rootmenu()
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (50 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 51/66] kconfig: gconf: rename display_tree_part() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-27 12:46   ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 53/66] kconfig: gconf: use size_allocate event handler Masahiro Yamada
                   ` (14 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The MENU_ROOT flag is a hack used for SPLIT_VIEW mode. Top-level symbols
have no parent menu, so they are displayed directly in the left pane.

Show the rootmenu, allowing top-level symbols to have a proper parent
menu and be displayed consistently in the right pane.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 164 +++++++++++++++++-----------------------
 1 file changed, 71 insertions(+), 93 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 23a6f99d2cd4..b86d54c222e3 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -56,9 +56,6 @@ enum {
 	COL_NUMBER
 };
 
-static void display_tree(GtkTreeStore *store, struct menu *menu);
-static void recreate_menu_content_tree(void);
-
 static void conf_changed(bool dirty)
 {
 	gtk_widget_set_sensitive(save_btn, dirty);
@@ -254,6 +251,74 @@ static void update_trees(void)
 	update_tree(tree2);
 }
 
+static void _recreate_menu_tree(GtkTreeStore *store, struct menu *menu,
+				GtkTreeIter *parent, gboolean menu_only)
+{
+	GtkTreeIter iter;
+
+	/* REVISIT: menu_finalize() creates empty "if" entries. */
+	if (menu->type == M_IF)
+		return;
+
+	if (!menu_only || menu->type == M_MENU) {
+		gtk_tree_store_append(store, &iter, parent);
+		set_node(store, &iter, menu);
+	}
+
+	for (struct menu *child = menu->list; child; child = child->next)
+		_recreate_menu_tree(store, child, &iter, menu_only);
+}
+
+static void recreate_menu_tree(void)
+{
+	GtkTreeStore *store;
+	GtkTreeView *view;
+
+	if (view_mode == SPLIT_VIEW) {
+		store = tree1;
+		view = GTK_TREE_VIEW(tree1_w);
+	} else {
+		store = tree2;
+		view = GTK_TREE_VIEW(tree2_w);
+	}
+
+	gtk_tree_store_clear(store);
+	_recreate_menu_tree(store, &rootmenu, NULL, view_mode == SPLIT_VIEW);
+	select_menu(view, browsed);
+	gtk_tree_view_expand_all(view);
+}
+
+static void _recreate_menu_content_tree(GtkTreeStore *store, struct menu *menu,
+					GtkTreeIter *parent, gboolean no_menu)
+{
+	for (struct menu *child = menu->list; child; child = child->next) {
+		GtkTreeIter iter;
+
+		/* REVISIT: menu_finalize() creates empty "if" entries. */
+		if (child->type == M_IF)
+			continue;
+
+		if (!no_menu || child->type != M_MENU) {
+			gtk_tree_store_append(store, &iter, parent);
+			set_node(store, &iter, child);
+		}
+
+		if (child->type != M_MENU)
+			_recreate_menu_content_tree(store, child, &iter,
+						    no_menu);
+	}
+}
+
+static void recreate_menu_content_tree(void)
+{
+	gtk_tree_store_clear(tree2);
+	if (browsed)
+		_recreate_menu_content_tree(tree2, browsed, NULL,
+					    view_mode == SPLIT_VIEW);
+	select_menu(GTK_TREE_VIEW(tree2_w), selected);
+	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w));
+}
+
 static void set_view_mode(enum view_mode mode)
 {
 	view_mode = mode;
@@ -280,7 +345,6 @@ static void set_view_mode(enum view_mode mode)
 		else
 			browsed = &rootmenu;
 		recreate_menu_content_tree();
-		select_menu(GTK_TREE_VIEW(tree2_w), selected);
 		gtk_widget_set_sensitive(single_btn, FALSE);
 		break;
 	case SPLIT_VIEW:
@@ -291,20 +355,12 @@ static void set_view_mode(enum view_mode mode)
 			else
 				browsed = menu_get_parent_menu(selected);
 		}
-		gtk_tree_store_clear(tree1);
-		display_tree(tree1, &rootmenu);
-		gtk_tree_view_expand_all(GTK_TREE_VIEW(tree1_w));
-		gtk_tree_store_clear(tree2);
-		if (browsed)
-			display_tree(tree2, browsed);
-		select_menu(GTK_TREE_VIEW(tree1_w), browsed);
-		select_menu(GTK_TREE_VIEW(tree2_w), selected);
+		recreate_menu_tree();
+		recreate_menu_content_tree();
 		gtk_widget_set_sensitive(split_btn, FALSE);
 		break;
 	case FULL_VIEW:
-		gtk_tree_store_clear(tree2);
-		display_tree(tree2, &rootmenu);
-		select_menu(GTK_TREE_VIEW(tree2_w), selected);
+		recreate_menu_tree();
 		gtk_widget_set_sensitive(full_btn, FALSE);
 		break;
 	}
@@ -917,83 +973,6 @@ static gboolean on_treeview1_button_press_event(GtkWidget *widget,
 	return FALSE;
 }
 
-/* Display the whole tree (single/split/full view) */
-static void _display_tree(GtkTreeStore *tree, struct menu *menu,
-			  GtkTreeIter *parent)
-{
-	struct property *prop;
-	struct menu *child;
-	enum prop_type ptype;
-	GtkTreeIter iter;
-
-	for (child = menu->list; child; child = child->next) {
-		/*
-		 * REVISIT:
-		 * menu_finalize() creates empty "if" entries.
-		 * Do not confuse gtk_tree_model_get(), which would otherwise
-		 * return "if" menu entry.
-		 */
-		if (child->type == M_IF)
-			continue;
-
-		prop = child->prompt;
-		ptype = prop ? prop->type : P_UNKNOWN;
-
-		if ((view_mode == SPLIT_VIEW)
-		    && !(child->flags & MENU_ROOT) && (tree == tree1))
-			continue;
-
-		if ((view_mode == SPLIT_VIEW) && (child->flags & MENU_ROOT)
-		    && (tree == tree2))
-			continue;
-
-		gtk_tree_store_append(tree, &iter, parent);
-		set_node(tree, &iter, child);
-
-		if ((view_mode != FULL_VIEW) && (ptype == P_MENU)
-		    && (tree == tree2))
-			continue;
-/*
-		if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT))
-		    || (view_mode == FULL_VIEW)
-		    || (view_mode == SPLIT_VIEW))*/
-
-		if (((view_mode == SINGLE_VIEW) && (menu->flags & MENU_ROOT))
-		    || (view_mode == FULL_VIEW)
-		    || (view_mode == SPLIT_VIEW))
-			_display_tree(tree, child, &iter);
-	}
-}
-
-static void display_tree(GtkTreeStore *store, struct menu *menu)
-{
-	_display_tree(store, menu, NULL);
-}
-
-/* Display a part of the tree starting at current node (single/split view) */
-static void recreate_menu_content_tree(void)
-{
-	gtk_tree_store_clear(tree2);
-	display_tree(tree2, browsed);
-	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w));
-}
-
-static void fixup_rootmenu(struct menu *menu)
-{
-	struct menu *child;
-	static int menu_cnt = 0;
-
-	menu->flags |= MENU_ROOT;
-	for (child = menu->list; child; child = child->next) {
-		if (child->prompt && child->prompt->type == P_MENU) {
-			menu_cnt++;
-			fixup_rootmenu(child);
-			menu_cnt--;
-		} else if (!menu_cnt)
-			fixup_rootmenu(child);
-	}
-}
-
 /* Main Window Initialization */
 static void replace_button_icon(GtkWidget *widget, const char * const xpm[])
 {
@@ -1354,7 +1333,6 @@ int main(int ac, char *av[])
 		name = av[1];
 
 	conf_parse(name);
-	fixup_rootmenu(&rootmenu);
 
 	/* Load the interface and connect signals */
 	init_main_window(glade_file);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 53/66] kconfig: gconf: use size_allocate event handler
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (51 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 52/66] kconfig: gconf: remove fixup_rootmenu() Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-29 17:56   ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 54/66] kconfig: gconf: replace GDK_space with GDK_KEY_space Masahiro Yamada
                   ` (13 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

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

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 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


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 54/66] kconfig: gconf: replace GDK_space with GDK_KEY_space
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (52 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 53/66] kconfig: gconf: use size_allocate event handler Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 55/66] kconfig: gconf: replace GTK_STOCK_{OK,NO,CANCEL} Masahiro Yamada
                   ` (12 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

In GTK3, keysyms changed to have a KEY_ prefix.

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gdk/gdkkeysyms-compat.h#L24

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 6487d6a0dd9d..28953449a1ed 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -887,7 +887,7 @@ static gboolean on_treeview2_key_press_event(GtkWidget *widget,
 	if (path == NULL)
 		return FALSE;
 
-	if (event->keyval == GDK_space) {
+	if (event->keyval == GDK_KEY_space) {
 		if (gtk_tree_view_row_expanded(view, path))
 			gtk_tree_view_collapse_row(view, path);
 		else
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 55/66] kconfig: gconf: replace GTK_STOCK_{OK,NO,CANCEL}
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (53 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 54/66] kconfig: gconf: replace GDK_space with GDK_KEY_space Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-30  5:26   ` Randy Dunlap
  2025-06-24 15:05 ` [PATCH 56/66] kconfig: gconf: remove "tooltips" property from glade Masahiro Yamada
                   ` (11 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

These are deprecated with GTK 3.10. [1]

Use "_OK", "_no", "_Cancel".

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/3.10.0/gtk/deprecated/gtkstock.h#L827

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 28953449a1ed..32d1815b425e 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -686,11 +686,11 @@ static gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
 					     (GtkDialogFlags)
 					     (GTK_DIALOG_MODAL |
 					      GTK_DIALOG_DESTROY_WITH_PARENT),
-					     GTK_STOCK_OK,
+					     "_OK",
 					     GTK_RESPONSE_YES,
-					     GTK_STOCK_NO,
+					     "_No",
 					     GTK_RESPONSE_NO,
-					     GTK_STOCK_CANCEL,
+					     "_Cancel",
 					     GTK_RESPONSE_CANCEL, NULL);
 	gtk_dialog_set_default_response(GTK_DIALOG(dialog),
 					GTK_RESPONSE_CANCEL);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 56/66] kconfig: gconf: remove "tooltips" property from glade
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (54 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 55/66] kconfig: gconf: replace GTK_STOCK_{OK,NO,CANCEL} Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 57/66] kconfig: gconf: replace "tooltip" property with "tooltip-text" Masahiro Yamada
                   ` (10 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The tips are still displayed without this.

This property does not exist in GtkBuilder with GTK 3.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.glade | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.glade
index 8519104a3c2b..c0ada331a5bf 100644
--- a/scripts/kconfig/gconf.glade
+++ b/scripts/kconfig/gconf.glade
@@ -225,7 +225,6 @@
 	      <property name="visible">True</property>
 	      <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
 	      <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
-	      <property name="tooltips">True</property>
 	      <property name="show_arrow">True</property>
 
 	      <child>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 57/66] kconfig: gconf: replace "tooltip" property with "tooltip-text"
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (55 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 56/66] kconfig: gconf: remove "tooltips" property from glade Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-30  5:36   ` Randy Dunlap
  2025-06-24 15:05 ` [PATCH 58/66] kconfig: gconf: remove unnecessary default message in text view Masahiro Yamada
                   ` (9 subsequent siblings)
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This was replaced with "tooltip-text" in GtkBuilder with GTK 3.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.glade | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.glade
index c0ada331a5bf..c3996f4635e9 100644
--- a/scripts/kconfig/gconf.glade
+++ b/scripts/kconfig/gconf.glade
@@ -40,7 +40,7 @@
 		  <child>
 		    <widget class="GtkImageMenuItem" id="load1">
 		      <property name="visible">True</property>
-		      <property name="tooltip" translatable="yes">Load a config file</property>
+		      <property name="tooltip-text" translatable="yes">Load a config file</property>
 		      <property name="label" translatable="yes">_Load</property>
 		      <property name="use_underline">True</property>
 		      <accelerator key="L" modifiers="GDK_CONTROL_MASK" signal="activate"/>
@@ -50,7 +50,7 @@
 		  <child>
 		    <widget class="GtkImageMenuItem" id="save1">
 		      <property name="visible">True</property>
-		      <property name="tooltip" translatable="yes">Save the config in .config</property>
+		      <property name="tooltip-text" translatable="yes">Save the config in .config</property>
 		      <property name="label" translatable="yes">_Save</property>
 		      <property name="use_underline">True</property>
 		      <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/>
@@ -60,7 +60,7 @@
 		  <child>
 		    <widget class="GtkImageMenuItem" id="save_as1">
 		      <property name="visible">True</property>
-		      <property name="tooltip" translatable="yes">Save the config in a file</property>
+		      <property name="tooltip-text" translatable="yes">Save the config in a file</property>
 		      <property name="label" translatable="yes">Save _as</property>
 		      <property name="use_underline">True</property>
 		    </widget>
@@ -97,7 +97,7 @@
 		  <child>
 		    <widget class="GtkCheckMenuItem" id="show_name1">
 		      <property name="visible">True</property>
-		      <property name="tooltip" translatable="yes">Show name</property>
+		      <property name="tooltip-text" translatable="yes">Show name</property>
 		      <property name="label" translatable="yes">Show _name</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
@@ -107,7 +107,7 @@
 		  <child>
 		    <widget class="GtkCheckMenuItem" id="show_range1">
 		      <property name="visible">True</property>
-		      <property name="tooltip" translatable="yes">Show range (Y/M/N)</property>
+		      <property name="tooltip-text" translatable="yes">Show range (Y/M/N)</property>
 		      <property name="label" translatable="yes">Show _range</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
@@ -117,7 +117,7 @@
 		  <child>
 		    <widget class="GtkCheckMenuItem" id="show_data1">
 		      <property name="visible">True</property>
-		      <property name="tooltip" translatable="yes">Show value of the option</property>
+		      <property name="tooltip-text" translatable="yes">Show value of the option</property>
 		      <property name="label" translatable="yes">Show _data</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
@@ -133,7 +133,7 @@
 		  <child>
 		    <widget class="GtkRadioMenuItem" id="set_option_mode1">
 		      <property name="visible">True</property>
-		      <property name="tooltip" translatable="yes">Show normal options</property>
+		      <property name="tooltip-text" translatable="yes">Show normal options</property>
 		      <property name="label" translatable="yes">Show normal options</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">True</property>
@@ -143,7 +143,7 @@
 		  <child>
 		    <widget class="GtkRadioMenuItem" id="set_option_mode2">
 		      <property name="visible">True</property>
-		      <property name="tooltip" translatable="yes">Show all options</property>
+		      <property name="tooltip-text" translatable="yes">Show all options</property>
 		      <property name="label" translatable="yes">Show all _options</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
@@ -154,7 +154,7 @@
 		  <child>
 		    <widget class="GtkRadioMenuItem" id="set_option_mode3">
 		      <property name="visible">True</property>
-		      <property name="tooltip" translatable="yes">Show all options with prompts</property>
+		      <property name="tooltip-text" translatable="yes">Show all options with prompts</property>
 		      <property name="label" translatable="yes">Show all prompt options</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
@@ -230,7 +230,7 @@
 	      <child>
 		<widget class="GtkToolButton" id="button1">
 		  <property name="visible">True</property>
-		  <property name="tooltip" translatable="yes">Goes up of one level (single view)</property>
+		  <property name="tooltip-text" translatable="yes">Goes up of one level (single view)</property>
 		  <property name="label" translatable="yes">Back</property>
 		  <property name="use_underline">True</property>
 		  <property name="stock_id">gtk-undo</property>
@@ -266,7 +266,7 @@
 	      <child>
 		<widget class="GtkToolButton" id="button2">
 		  <property name="visible">True</property>
-		  <property name="tooltip" translatable="yes">Load a config file</property>
+		  <property name="tooltip-text" translatable="yes">Load a config file</property>
 		  <property name="label" translatable="yes">Load</property>
 		  <property name="use_underline">True</property>
 		  <property name="stock_id">gtk-open</property>
@@ -283,7 +283,7 @@
 	      <child>
 		<widget class="GtkToolButton" id="button3">
 		  <property name="visible">True</property>
-		  <property name="tooltip" translatable="yes">Save a config file</property>
+		  <property name="tooltip-text" translatable="yes">Save a config file</property>
 		  <property name="label" translatable="yes">Save</property>
 		  <property name="use_underline">True</property>
 		  <property name="stock_id">gtk-save</property>
@@ -319,7 +319,7 @@
 	      <child>
 		<widget class="GtkToolButton" id="button4">
 		  <property name="visible">True</property>
-		  <property name="tooltip" translatable="yes">Single view</property>
+		  <property name="tooltip-text" translatable="yes">Single view</property>
 		  <property name="label" translatable="yes">Single</property>
 		  <property name="use_underline">True</property>
 		  <property name="stock_id">gtk-missing-image</property>
@@ -336,7 +336,7 @@
 	      <child>
 		<widget class="GtkToolButton" id="button5">
 		  <property name="visible">True</property>
-		  <property name="tooltip" translatable="yes">Split view</property>
+		  <property name="tooltip-text" translatable="yes">Split view</property>
 		  <property name="label" translatable="yes">Split</property>
 		  <property name="use_underline">True</property>
 		  <property name="stock_id">gtk-missing-image</property>
@@ -353,7 +353,7 @@
 	      <child>
 		<widget class="GtkToolButton" id="button6">
 		  <property name="visible">True</property>
-		  <property name="tooltip" translatable="yes">Full view</property>
+		  <property name="tooltip-text" translatable="yes">Full view</property>
 		  <property name="label" translatable="yes">Full</property>
 		  <property name="use_underline">True</property>
 		  <property name="stock_id">gtk-missing-image</property>
@@ -389,7 +389,7 @@
 	      <child>
 		<widget class="GtkToolButton" id="button7">
 		  <property name="visible">True</property>
-		  <property name="tooltip" translatable="yes">Collapse the whole tree in the right frame</property>
+		  <property name="tooltip-text" translatable="yes">Collapse the whole tree in the right frame</property>
 		  <property name="label" translatable="yes">Collapse</property>
 		  <property name="use_underline">True</property>
 		  <property name="stock_id">gtk-remove</property>
@@ -406,7 +406,7 @@
 	      <child>
 		<widget class="GtkToolButton" id="button8">
 		  <property name="visible">True</property>
-		  <property name="tooltip" translatable="yes">Expand the whole tree in the right frame</property>
+		  <property name="tooltip-text" translatable="yes">Expand the whole tree in the right frame</property>
 		  <property name="label" translatable="yes">Expand</property>
 		  <property name="use_underline">True</property>
 		  <property name="stock_id">gtk-add</property>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 58/66] kconfig: gconf: remove unnecessary default message in text view
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (56 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 57/66] kconfig: gconf: replace "tooltip" property with "tooltip-text" Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 59/66] kconfig: gconf: use gtk_check_menu_item_get_active() accessor Masahiro Yamada
                   ` (8 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This message looks odd because it is displayed when nothing is selected.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.glade | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.glade
index c3996f4635e9..b2e15b23744f 100644
--- a/scripts/kconfig/gconf.glade
+++ b/scripts/kconfig/gconf.glade
@@ -517,7 +517,6 @@
 		      <property name="left_margin">0</property>
 		      <property name="right_margin">0</property>
 		      <property name="indent">0</property>
-		      <property name="text" translatable="yes">Sorry, no help available for this option yet.</property>
 		    </widget>
 		  </child>
 		</widget>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 59/66] kconfig: gconf: use gtk_check_menu_item_get_active() accessor
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (57 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 58/66] kconfig: gconf: remove unnecessary default message in text view Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 60/66] kconfig: gconf: use gtk_dialog_get_content_area() accessor Masahiro Yamada
                   ` (7 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

GTK 3 removes many implementation details and struct members from its
public headers.

Use the gtk_check_menu_item_get_active() accessor.

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/docs/reference/gtk/compiling.sgml#L85

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 32d1815b425e..c49401b4c9a1 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -493,7 +493,7 @@ static void on_show_name1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
 	GtkTreeViewColumn *col;
 
-	show_name = GTK_CHECK_MENU_ITEM(menuitem)->active;
+	show_name = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem));
 	col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_NAME);
 	if (col)
 		gtk_tree_view_column_set_visible(col, show_name);
@@ -503,7 +503,7 @@ static void on_show_range1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
 	GtkTreeViewColumn *col;
 
-	show_range = GTK_CHECK_MENU_ITEM(menuitem)->active;
+	show_range = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem));
 	col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_NO);
 	if (col)
 		gtk_tree_view_column_set_visible(col, show_range);
@@ -520,7 +520,7 @@ static void on_show_data1_activate(GtkMenuItem *menuitem, gpointer user_data)
 {
 	GtkTreeViewColumn *col;
 
-	show_value = GTK_CHECK_MENU_ITEM(menuitem)->active;
+	show_value = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem));
 	col = gtk_tree_view_get_column(GTK_TREE_VIEW(tree2_w), COL_VALUE);
 	if (col)
 		gtk_tree_view_column_set_visible(col, show_value);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 60/66] kconfig: gconf: use gtk_dialog_get_content_area() accessor
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (58 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 59/66] kconfig: gconf: use gtk_check_menu_item_get_active() accessor Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 61/66] kconfig: gconf: remove GtkHandleBox from glade Masahiro Yamada
                   ` (6 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

GTK 3 removes many implementation details and struct members from its
public headers.

Use the gtk_check_menu_item_get_active() accessor.

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/docs/reference/gtk/compiling.sgml#L85

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index c49401b4c9a1..58da3f13c5a0 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -674,7 +674,7 @@ static void on_window_size_allocate(GtkWidget *widget,
 static gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
 					gpointer user_data)
 {
-	GtkWidget *dialog, *label;
+	GtkWidget *dialog, *label, *content_area;
 	gint result;
 	gint ret = FALSE;
 
@@ -696,7 +696,8 @@ static gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
 					GTK_RESPONSE_CANCEL);
 
 	label = gtk_label_new("\nSave configuration ?\n");
-	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
+	content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+	gtk_container_add(GTK_CONTAINER(content_area), label);
 	gtk_widget_show(label);
 
 	result = gtk_dialog_run(GTK_DIALOG(dialog));
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 61/66] kconfig: gconf: remove GtkHandleBox from glade
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (59 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 60/66] kconfig: gconf: use gtk_dialog_get_content_area() accessor Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 62/66] kconfig: gconf: rename gconf.glade to gconf.ui Masahiro Yamada
                   ` (5 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

GtkHandleBox is deprecated with GTK 3.4. [1]

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/3.4.0/gtk/deprecated/gtkhandlebox.c#L426

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.glade | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.glade
index b2e15b23744f..f0c572c7f47c 100644
--- a/scripts/kconfig/gconf.glade
+++ b/scripts/kconfig/gconf.glade
@@ -214,13 +214,6 @@
       </child>
 
       <child>
-	<widget class="GtkHandleBox" id="handlebox1">
-	  <property name="visible">True</property>
-	  <property name="shadow_type">GTK_SHADOW_OUT</property>
-	  <property name="handle_position">GTK_POS_LEFT</property>
-	  <property name="snap_edge">GTK_POS_TOP</property>
-
-	  <child>
 	    <widget class="GtkToolbar" id="toolbar1">
 	      <property name="visible">True</property>
 	      <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
@@ -420,8 +413,6 @@
 		</packing>
 	      </child>
 	    </widget>
-	  </child>
-	</widget>
 	<packing>
 	  <property name="padding">0</property>
 	  <property name="expand">False</property>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 62/66] kconfig: gconf: rename gconf.glade to gconf.ui
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (60 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 61/66] kconfig: gconf: remove GtkHandleBox from glade Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 63/66] kconfig: gconf: migrate to GTK 3 Masahiro Yamada
                   ` (4 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The next commit will convert this file to GtkBuilder format. Rename
it in advance to reflect the intended format.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c                   | 6 +++---
 scripts/kconfig/{gconf.glade => gconf.ui} | 0
 2 files changed, 3 insertions(+), 3 deletions(-)
 rename scripts/kconfig/{gconf.glade => gconf.ui} (100%)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 58da3f13c5a0..4c6459cc26e7 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -1301,11 +1301,11 @@ int main(int ac, char *av[])
 	/* Determine GUI path */
 	env = getenv(SRCTREE);
 	if (env)
-		glade_file = g_strconcat(env, "/scripts/kconfig/gconf.glade", NULL);
+		glade_file = g_strconcat(env, "/scripts/kconfig/gconf.ui", NULL);
 	else if (av[0][0] == '/')
-		glade_file = g_strconcat(av[0], ".glade", NULL);
+		glade_file = g_strconcat(av[0], ".ui", NULL);
 	else
-		glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".glade", NULL);
+		glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".ui", NULL);
 
 	/* Conf stuffs */
 	if (ac > 1 && av[1][0] == '-') {
diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.ui
similarity index 100%
rename from scripts/kconfig/gconf.glade
rename to scripts/kconfig/gconf.ui
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 63/66] kconfig: gconf: migrate to GTK 3
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (61 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 62/66] kconfig: gconf: rename gconf.glade to gconf.ui Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 64/66] kconfig: gconf: replace GtkVbox with GtkBox Masahiro Yamada
                   ` (3 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

This commit switches from GTK 2.x to GTK 3, applying the following
necessary changes:

 - Do not include invidual headers
 - GtkObject is gone
 - Convert glade to GtkBuilder

[1]: https://docs.gtk.org/gtk3/migrating-2to3.html

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf-cfg.sh |  11 +-
 scripts/kconfig/gconf.c      |  72 ++++++-------
 scripts/kconfig/gconf.ui     | 200 +++++++++++++++++------------------
 3 files changed, 136 insertions(+), 147 deletions(-)

diff --git a/scripts/kconfig/gconf-cfg.sh b/scripts/kconfig/gconf-cfg.sh
index fc954c0538fa..856c692f480c 100755
--- a/scripts/kconfig/gconf-cfg.sh
+++ b/scripts/kconfig/gconf-cfg.sh
@@ -6,7 +6,7 @@ set -eu
 cflags=$1
 libs=$2
 
-PKG="gtk+-2.0 gmodule-2.0 libglade-2.0"
+PKG=gtk+-3.0
 
 if [ -z "$(command -v ${HOSTPKG_CONFIG})" ]; then
 	echo >&2 "*"
@@ -18,18 +18,11 @@ fi
 if ! ${HOSTPKG_CONFIG} --exists $PKG; then
 	echo >&2 "*"
 	echo >&2 "* Unable to find the GTK+ installation. Please make sure that"
-	echo >&2 "* the GTK+ 2.0 development package is correctly installed."
+	echo >&2 "* the GTK 3 development package is correctly installed."
 	echo >&2 "* You need $PKG"
 	echo >&2 "*"
 	exit 1
 fi
 
-if ! ${HOSTPKG_CONFIG} --atleast-version=2.0.0 gtk+-2.0; then
-	echo >&2 "*"
-	echo >&2 "* GTK+ is present but version >= 2.0.0 is required."
-	echo >&2 "*"
-	exit 1
-fi
-
 ${HOSTPKG_CONFIG} --cflags ${PKG} > ${cflags}
 ${HOSTPKG_CONFIG} --libs ${PKG} > ${libs}
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 4c6459cc26e7..5959ed255d12 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -7,10 +7,7 @@
 #include "lkc.h"
 #include "images.h"
 
-#include <glade/glade.h>
 #include <gtk/gtk.h>
-#include <glib.h>
-#include <gdk/gdkkeysyms.h>
 
 #include <stdio.h>
 #include <string.h>
@@ -655,7 +652,7 @@ static void on_expand_clicked(GtkButton *button, gpointer user_data)
 
 /* Main Windows Callbacks */
 
-static void on_window1_destroy(GtkObject *object, gpointer user_data)
+static void on_window1_destroy(GtkWidget *widget, gpointer user_data)
 {
 	gtk_main_quit();
 }
@@ -982,15 +979,15 @@ static void replace_button_icon(GtkWidget *widget, const char * const xpm[])
 
 static void init_main_window(const gchar *glade_file)
 {
-	GladeXML *xml;
+	GtkBuilder *builder;
 	GtkWidget *widget;
 	GtkTextBuffer *txtbuf;
 
-	xml = glade_xml_new(glade_file, "window1", NULL);
-	if (!xml)
+	builder = gtk_builder_new_from_file(glade_file);
+	if (!builder)
 		g_error("GUI loading failed !\n");
 
-	main_wnd = glade_xml_get_widget(xml, "window1");
+	main_wnd = GTK_WIDGET(gtk_builder_get_object(builder, "window1"));
 	g_signal_connect(main_wnd, "destroy",
 			 G_CALLBACK(on_window1_destroy), NULL);
 	g_signal_connect(main_wnd, "size_allocate",
@@ -998,9 +995,9 @@ static void init_main_window(const gchar *glade_file)
 	g_signal_connect(main_wnd, "delete_event",
 			 G_CALLBACK(on_window1_delete_event), NULL);
 
-	hpaned = glade_xml_get_widget(xml, "hpaned1");
-	vpaned = glade_xml_get_widget(xml, "vpaned1");
-	tree1_w = glade_xml_get_widget(xml, "treeview1");
+	hpaned = GTK_WIDGET(gtk_builder_get_object(builder, "hpaned1"));
+	vpaned = GTK_WIDGET(gtk_builder_get_object(builder, "vpaned1"));
+	tree1_w = GTK_WIDGET(gtk_builder_get_object(builder, "treeview1"));
 	g_signal_connect(tree1_w, "cursor_changed",
 			 G_CALLBACK(on_treeview2_cursor_changed), NULL);
 	g_signal_connect(tree1_w, "button_press_event",
@@ -1008,7 +1005,7 @@ static void init_main_window(const gchar *glade_file)
 	g_signal_connect(tree1_w, "key_press_event",
 			 G_CALLBACK(on_treeview2_key_press_event), NULL);
 
-	tree2_w = glade_xml_get_widget(xml, "treeview2");
+	tree2_w = GTK_WIDGET(gtk_builder_get_object(builder, "treeview2"));
 	g_signal_connect(tree2_w, "cursor_changed",
 			 G_CALLBACK(on_treeview2_cursor_changed), NULL);
 	g_signal_connect(tree2_w, "button_press_event",
@@ -1016,96 +1013,96 @@ static void init_main_window(const gchar *glade_file)
 	g_signal_connect(tree2_w, "key_press_event",
 			 G_CALLBACK(on_treeview2_key_press_event), NULL);
 
-	text_w = glade_xml_get_widget(xml, "textview3");
+	text_w = GTK_WIDGET(gtk_builder_get_object(builder, "textview3"));
 
 	/* menubar */
-	widget = glade_xml_get_widget(xml, "load1");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "load1"));
 	g_signal_connect(widget, "activate", G_CALLBACK(on_load1_activate), NULL);
 
-	widget = glade_xml_get_widget(xml, "save1");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "save1"));
 	g_signal_connect(widget, "activate", G_CALLBACK(on_save_activate), NULL);
 
-	widget = glade_xml_get_widget(xml, "save_as1");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "save_as1"));
 	g_signal_connect(widget, "activate", G_CALLBACK(on_save_as1_activate), NULL);
 
-	widget = glade_xml_get_widget(xml, "quit1");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "quit1"));
 	g_signal_connect(widget, "activate", G_CALLBACK(on_quit1_activate), NULL);
 
-	widget = glade_xml_get_widget(xml, "show_name1");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "show_name1"));
 	g_signal_connect(widget, "activate", G_CALLBACK(on_show_name1_activate), NULL);
 	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
 				       show_name);
 
-	widget = glade_xml_get_widget(xml, "show_range1");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "show_range1"));
 	g_signal_connect(widget, "activate", G_CALLBACK(on_show_range1_activate), NULL);
 	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
 				       show_range);
 
-	widget = glade_xml_get_widget(xml, "show_data1");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "show_data1"));
 	g_signal_connect(widget, "activate", G_CALLBACK(on_show_data1_activate), NULL);
 	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
 				       show_value);
 
-	widget = glade_xml_get_widget(xml, "set_option_mode1");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "set_option_mode1"));
 	g_signal_connect(widget, "activate",
 			 G_CALLBACK(on_set_option_mode1_activate), NULL);
 
-	widget = glade_xml_get_widget(xml, "set_option_mode2");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "set_option_mode2"));
 	g_signal_connect(widget, "activate",
 			 G_CALLBACK(on_set_option_mode2_activate), NULL);
 
-	widget = glade_xml_get_widget(xml, "set_option_mode3");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "set_option_mode3"));
 	g_signal_connect(widget, "activate",
 			 G_CALLBACK(on_set_option_mode3_activate), NULL);
 
-	widget = glade_xml_get_widget(xml, "introduction1");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "introduction1"));
 	g_signal_connect(widget, "activate",
 			 G_CALLBACK(on_introduction1_activate), NULL);
 
-	widget = glade_xml_get_widget(xml, "about1");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "about1"));
 	g_signal_connect(widget, "activate",
 			 G_CALLBACK(on_about1_activate), NULL);
 
-	widget = glade_xml_get_widget(xml, "license1");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "license1"));
 	g_signal_connect(widget, "activate",
 			 G_CALLBACK(on_license1_activate), NULL);
 
 	/* toolbar */
-	back_btn = glade_xml_get_widget(xml, "button1");
+	back_btn = GTK_WIDGET(gtk_builder_get_object(builder, "button1"));
 	g_signal_connect(back_btn, "clicked",
 			 G_CALLBACK(on_back_clicked), NULL);
 	gtk_widget_set_sensitive(back_btn, FALSE);
 
-	widget = glade_xml_get_widget(xml, "button2");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "button2"));
 	g_signal_connect(widget, "clicked",
 			 G_CALLBACK(on_load_clicked), NULL);
 
-	save_btn = glade_xml_get_widget(xml, "button3");
+	save_btn = GTK_WIDGET(gtk_builder_get_object(builder, "button3"));
 	g_signal_connect(save_btn, "clicked",
 			 G_CALLBACK(on_save_clicked), NULL);
-	save_menu_item = glade_xml_get_widget(xml, "save1");
+	save_menu_item = GTK_WIDGET(gtk_builder_get_object(builder, "save1"));
 	conf_set_changed_callback(conf_changed);
 
-	single_btn = glade_xml_get_widget(xml, "button4");
+	single_btn = GTK_WIDGET(gtk_builder_get_object(builder, "button4"));
 	g_signal_connect(single_btn, "clicked",
 			 G_CALLBACK(on_single_clicked), NULL);
 	replace_button_icon(single_btn, xpm_single_view);
 
-	split_btn = glade_xml_get_widget(xml, "button5");
+	split_btn = GTK_WIDGET(gtk_builder_get_object(builder, "button5"));
 	g_signal_connect(split_btn, "clicked",
 			 G_CALLBACK(on_split_clicked), NULL);
 	replace_button_icon(split_btn, xpm_split_view);
 
-	full_btn = glade_xml_get_widget(xml, "button6");
+	full_btn = GTK_WIDGET(gtk_builder_get_object(builder, "button6"));
 	g_signal_connect(full_btn, "clicked",
 			 G_CALLBACK(on_full_clicked), NULL);
 	replace_button_icon(full_btn, xpm_tree_view);
 
-	widget = glade_xml_get_widget(xml, "button7");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "button7"));
 	g_signal_connect(widget, "clicked",
 			 G_CALLBACK(on_collapse_clicked), NULL);
 
-	widget = glade_xml_get_widget(xml, "button8");
+	widget = GTK_WIDGET(gtk_builder_get_object(builder, "button8"));
 	g_signal_connect(widget, "clicked",
 			 G_CALLBACK(on_expand_clicked), NULL);
 
@@ -1120,7 +1117,9 @@ static void init_main_window(const gchar *glade_file)
 
 	gtk_window_set_title(GTK_WINDOW(main_wnd), rootmenu.prompt->text);
 
-	gtk_widget_show(main_wnd);
+	gtk_widget_show_all(main_wnd);
+
+	g_object_unref(builder);
 }
 
 static gboolean visible_func(GtkTreeModel *model, GtkTreeIter  *iter,
@@ -1296,7 +1295,6 @@ int main(int ac, char *av[])
 
 	/* GTK stuffs */
 	gtk_init(&ac, &av);
-	glade_init();
 
 	/* Determine GUI path */
 	env = getenv(SRCTREE);
diff --git a/scripts/kconfig/gconf.ui b/scripts/kconfig/gconf.ui
index f0c572c7f47c..e5dad2b06502 100644
--- a/scripts/kconfig/gconf.ui
+++ b/scripts/kconfig/gconf.ui
@@ -1,8 +1,8 @@
 <?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
 
-<glade-interface>
+<interface>
 
-<widget class="GtkWindow" id="window1">
+<object class="GtkWindow" id="window1">
   <property name="visible">True</property>
   <property name="title" translatable="yes">Gtk Kernel Configurator</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
@@ -19,193 +19,193 @@
   <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
 
   <child>
-    <widget class="GtkVBox" id="vbox1">
+    <object class="GtkVBox" id="vbox1">
       <property name="visible">True</property>
       <property name="homogeneous">False</property>
       <property name="spacing">0</property>
 
       <child>
-	<widget class="GtkMenuBar" id="menubar1">
+	<object class="GtkMenuBar" id="menubar1">
 	  <property name="visible">True</property>
 
 	  <child>
-	    <widget class="GtkMenuItem" id="file1">
+	    <object class="GtkMenuItem" id="file1">
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">_File</property>
 	      <property name="use_underline">True</property>
 
-	      <child>
-		<widget class="GtkMenu" id="file1_menu">
+	      <child type="submenu">
+		<object class="GtkMenu" id="file1_menu">
 
 		  <child>
-		    <widget class="GtkImageMenuItem" id="load1">
+		    <object class="GtkImageMenuItem" id="load1">
 		      <property name="visible">True</property>
 		      <property name="tooltip-text" translatable="yes">Load a config file</property>
 		      <property name="label" translatable="yes">_Load</property>
 		      <property name="use_underline">True</property>
 		      <accelerator key="L" modifiers="GDK_CONTROL_MASK" signal="activate"/>
-		    </widget>
+		    </object>
 		  </child>
 
 		  <child>
-		    <widget class="GtkImageMenuItem" id="save1">
+		    <object class="GtkImageMenuItem" id="save1">
 		      <property name="visible">True</property>
 		      <property name="tooltip-text" translatable="yes">Save the config in .config</property>
 		      <property name="label" translatable="yes">_Save</property>
 		      <property name="use_underline">True</property>
 		      <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/>
-		    </widget>
+		    </object>
 		  </child>
 
 		  <child>
-		    <widget class="GtkImageMenuItem" id="save_as1">
+		    <object class="GtkImageMenuItem" id="save_as1">
 		      <property name="visible">True</property>
 		      <property name="tooltip-text" translatable="yes">Save the config in a file</property>
 		      <property name="label" translatable="yes">Save _as</property>
 		      <property name="use_underline">True</property>
-		    </widget>
+		    </object>
 		  </child>
 
 		  <child>
-		    <widget class="GtkSeparatorMenuItem" id="separator1">
+		    <object class="GtkSeparatorMenuItem" id="separator1">
 		      <property name="visible">True</property>
-		    </widget>
+		    </object>
 		  </child>
 
 		  <child>
-		    <widget class="GtkImageMenuItem" id="quit1">
+		    <object class="GtkImageMenuItem" id="quit1">
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">_Quit</property>
 		      <property name="use_underline">True</property>
 		      <accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
-		    </widget>
+		    </object>
 		  </child>
-		</widget>
+		</object>
 	      </child>
-	    </widget>
+	    </object>
 	  </child>
 
 	  <child>
-	    <widget class="GtkMenuItem" id="options1">
+	    <object class="GtkMenuItem" id="options1">
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">_Options</property>
 	      <property name="use_underline">True</property>
 
-	      <child>
-		<widget class="GtkMenu" id="options1_menu">
+	      <child type="submenu">
+		<object class="GtkMenu" id="options1_menu">
 
 		  <child>
-		    <widget class="GtkCheckMenuItem" id="show_name1">
+		    <object class="GtkCheckMenuItem" id="show_name1">
 		      <property name="visible">True</property>
 		      <property name="tooltip-text" translatable="yes">Show name</property>
 		      <property name="label" translatable="yes">Show _name</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
-		    </widget>
+		    </object>
 		  </child>
 
 		  <child>
-		    <widget class="GtkCheckMenuItem" id="show_range1">
+		    <object class="GtkCheckMenuItem" id="show_range1">
 		      <property name="visible">True</property>
 		      <property name="tooltip-text" translatable="yes">Show range (Y/M/N)</property>
 		      <property name="label" translatable="yes">Show _range</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
-		    </widget>
+		    </object>
 		  </child>
 
 		  <child>
-		    <widget class="GtkCheckMenuItem" id="show_data1">
+		    <object class="GtkCheckMenuItem" id="show_data1">
 		      <property name="visible">True</property>
 		      <property name="tooltip-text" translatable="yes">Show value of the option</property>
 		      <property name="label" translatable="yes">Show _data</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
-		    </widget>
+		    </object>
 		  </child>
 
 		  <child>
-		    <widget class="GtkSeparatorMenuItem" id="separator2">
+		    <object class="GtkSeparatorMenuItem" id="separator2">
 		      <property name="visible">True</property>
-		    </widget>
+		    </object>
 		  </child>
 
 		  <child>
-		    <widget class="GtkRadioMenuItem" id="set_option_mode1">
+		    <object class="GtkRadioMenuItem" id="set_option_mode1">
 		      <property name="visible">True</property>
 		      <property name="tooltip-text" translatable="yes">Show normal options</property>
 		      <property name="label" translatable="yes">Show normal options</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">True</property>
-		    </widget>
+		    </object>
 		  </child>
 
 		  <child>
-		    <widget class="GtkRadioMenuItem" id="set_option_mode2">
+		    <object class="GtkRadioMenuItem" id="set_option_mode2">
 		      <property name="visible">True</property>
 		      <property name="tooltip-text" translatable="yes">Show all options</property>
 		      <property name="label" translatable="yes">Show all _options</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
 		      <property name="group">set_option_mode1</property>
-		    </widget>
+		    </object>
 		  </child>
 
 		  <child>
-		    <widget class="GtkRadioMenuItem" id="set_option_mode3">
+		    <object class="GtkRadioMenuItem" id="set_option_mode3">
 		      <property name="visible">True</property>
 		      <property name="tooltip-text" translatable="yes">Show all options with prompts</property>
 		      <property name="label" translatable="yes">Show all prompt options</property>
 		      <property name="use_underline">True</property>
 		      <property name="active">False</property>
 		      <property name="group">set_option_mode1</property>
-		    </widget>
+		    </object>
 		  </child>
 
-		</widget>
+		</object>
 	      </child>
-	    </widget>
+	    </object>
 	  </child>
 
 	  <child>
-	    <widget class="GtkMenuItem" id="help1">
+	    <object class="GtkMenuItem" id="help1">
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">_Help</property>
 	      <property name="use_underline">True</property>
 
-	      <child>
-		<widget class="GtkMenu" id="help1_menu">
+	      <child type="submenu">
+		<object class="GtkMenu" id="help1_menu">
 
 		  <child>
-		    <widget class="GtkImageMenuItem" id="introduction1">
+		    <object class="GtkImageMenuItem" id="introduction1">
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">_Introduction</property>
 		      <property name="use_underline">True</property>
 		      <accelerator key="I" modifiers="GDK_CONTROL_MASK" signal="activate"/>
-		    </widget>
+		    </object>
 		  </child>
 
 		  <child>
-		    <widget class="GtkImageMenuItem" id="about1">
+		    <object class="GtkImageMenuItem" id="about1">
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">_About</property>
 		      <property name="use_underline">True</property>
 		      <accelerator key="A" modifiers="GDK_CONTROL_MASK" signal="activate"/>
-		    </widget>
+		    </object>
 		  </child>
 
 		  <child>
-		    <widget class="GtkImageMenuItem" id="license1">
+		    <object class="GtkImageMenuItem" id="license1">
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">_License</property>
 		      <property name="use_underline">True</property>
-		    </widget>
+		    </object>
 		  </child>
-		</widget>
+		</object>
 	      </child>
-	    </widget>
+	    </object>
 	  </child>
-	</widget>
+	</object>
 	<packing>
 	  <property name="padding">0</property>
 	  <property name="expand">False</property>
@@ -214,14 +214,14 @@
       </child>
 
       <child>
-	    <widget class="GtkToolbar" id="toolbar1">
+	    <object class="GtkToolbar" id="toolbar1">
 	      <property name="visible">True</property>
 	      <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
 	      <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
 	      <property name="show_arrow">True</property>
 
 	      <child>
-		<widget class="GtkToolButton" id="button1">
+		<object class="GtkToolButton" id="button1">
 		  <property name="visible">True</property>
 		  <property name="tooltip-text" translatable="yes">Goes up of one level (single view)</property>
 		  <property name="label" translatable="yes">Back</property>
@@ -230,7 +230,7 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		</widget>
+		</object>
 		<packing>
 		  <property name="expand">False</property>
 		  <property name="homogeneous">True</property>
@@ -238,18 +238,18 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkToolItem" id="toolitem1">
+		<object class="GtkToolItem" id="toolitem1">
 		  <property name="visible">True</property>
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
 
 		  <child>
-		    <widget class="GtkVSeparator" id="vseparator1">
+		    <object class="GtkVSeparator" id="vseparator1">
 		      <property name="visible">True</property>
-		    </widget>
+		    </object>
 		  </child>
-		</widget>
+		</object>
 		<packing>
 		  <property name="expand">False</property>
 		  <property name="homogeneous">False</property>
@@ -257,7 +257,7 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkToolButton" id="button2">
+		<object class="GtkToolButton" id="button2">
 		  <property name="visible">True</property>
 		  <property name="tooltip-text" translatable="yes">Load a config file</property>
 		  <property name="label" translatable="yes">Load</property>
@@ -266,7 +266,7 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		</widget>
+		</object>
 		<packing>
 		  <property name="expand">False</property>
 		  <property name="homogeneous">True</property>
@@ -274,7 +274,7 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkToolButton" id="button3">
+		<object class="GtkToolButton" id="button3">
 		  <property name="visible">True</property>
 		  <property name="tooltip-text" translatable="yes">Save a config file</property>
 		  <property name="label" translatable="yes">Save</property>
@@ -283,7 +283,7 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		</widget>
+		</object>
 		<packing>
 		  <property name="expand">False</property>
 		  <property name="homogeneous">True</property>
@@ -291,18 +291,18 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkToolItem" id="toolitem2">
+		<object class="GtkToolItem" id="toolitem2">
 		  <property name="visible">True</property>
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
 
 		  <child>
-		    <widget class="GtkVSeparator" id="vseparator2">
+		    <object class="GtkVSeparator" id="vseparator2">
 		      <property name="visible">True</property>
-		    </widget>
+		    </object>
 		  </child>
-		</widget>
+		</object>
 		<packing>
 		  <property name="expand">False</property>
 		  <property name="homogeneous">False</property>
@@ -310,7 +310,7 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkToolButton" id="button4">
+		<object class="GtkToolButton" id="button4">
 		  <property name="visible">True</property>
 		  <property name="tooltip-text" translatable="yes">Single view</property>
 		  <property name="label" translatable="yes">Single</property>
@@ -319,7 +319,7 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		</widget>
+		</object>
 		<packing>
 		  <property name="expand">False</property>
 		  <property name="homogeneous">True</property>
@@ -327,7 +327,7 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkToolButton" id="button5">
+		<object class="GtkToolButton" id="button5">
 		  <property name="visible">True</property>
 		  <property name="tooltip-text" translatable="yes">Split view</property>
 		  <property name="label" translatable="yes">Split</property>
@@ -336,7 +336,7 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		</widget>
+		</object>
 		<packing>
 		  <property name="expand">False</property>
 		  <property name="homogeneous">True</property>
@@ -344,7 +344,7 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkToolButton" id="button6">
+		<object class="GtkToolButton" id="button6">
 		  <property name="visible">True</property>
 		  <property name="tooltip-text" translatable="yes">Full view</property>
 		  <property name="label" translatable="yes">Full</property>
@@ -353,7 +353,7 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		</widget>
+		</object>
 		<packing>
 		  <property name="expand">False</property>
 		  <property name="homogeneous">True</property>
@@ -361,18 +361,18 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkToolItem" id="toolitem3">
+		<object class="GtkToolItem" id="toolitem3">
 		  <property name="visible">True</property>
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
 
 		  <child>
-		    <widget class="GtkVSeparator" id="vseparator3">
+		    <object class="GtkVSeparator" id="vseparator3">
 		      <property name="visible">True</property>
-		    </widget>
+		    </object>
 		  </child>
-		</widget>
+		</object>
 		<packing>
 		  <property name="expand">False</property>
 		  <property name="homogeneous">False</property>
@@ -380,7 +380,7 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkToolButton" id="button7">
+		<object class="GtkToolButton" id="button7">
 		  <property name="visible">True</property>
 		  <property name="tooltip-text" translatable="yes">Collapse the whole tree in the right frame</property>
 		  <property name="label" translatable="yes">Collapse</property>
@@ -389,7 +389,7 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		</widget>
+		</object>
 		<packing>
 		  <property name="expand">False</property>
 		  <property name="homogeneous">True</property>
@@ -397,7 +397,7 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkToolButton" id="button8">
+		<object class="GtkToolButton" id="button8">
 		  <property name="visible">True</property>
 		  <property name="tooltip-text" translatable="yes">Expand the whole tree in the right frame</property>
 		  <property name="label" translatable="yes">Expand</property>
@@ -406,13 +406,13 @@
 		  <property name="visible_horizontal">True</property>
 		  <property name="visible_vertical">True</property>
 		  <property name="is_important">False</property>
-		</widget>
+		</object>
 		<packing>
 		  <property name="expand">False</property>
 		  <property name="homogeneous">True</property>
 		</packing>
 	      </child>
-	    </widget>
+	    </object>
 	<packing>
 	  <property name="padding">0</property>
 	  <property name="expand">False</property>
@@ -421,14 +421,13 @@
       </child>
 
       <child>
-	<widget class="GtkHPaned" id="hpaned1">
+	<object class="GtkHPaned" id="hpaned1">
 	  <property name="width_request">1</property>
 	  <property name="visible">True</property>
 	  <property name="can_focus">True</property>
-	  <property name="position">0</property>
 
 	  <child>
-	    <widget class="GtkScrolledWindow" id="scrolledwindow1">
+	    <object class="GtkScrolledWindow" id="scrolledwindow1">
 	      <property name="visible">True</property>
 	      <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
 	      <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
@@ -436,16 +435,16 @@
 	      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 	      <child>
-		<widget class="GtkTreeView" id="treeview1">
+		<object class="GtkTreeView" id="treeview1">
 		  <property name="visible">True</property>
 		  <property name="can_focus">True</property>
 		  <property name="headers_visible">True</property>
 		  <property name="rules_hint">False</property>
 		  <property name="reorderable">False</property>
 		  <property name="enable_search">False</property>
-		</widget>
+		</object>
 	      </child>
-	    </widget>
+	    </object>
 	    <packing>
 	      <property name="shrink">True</property>
 	      <property name="resize">False</property>
@@ -453,13 +452,12 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkVPaned" id="vpaned1">
+	    <object class="GtkVPaned" id="vpaned1">
 	      <property name="visible">True</property>
 	      <property name="can_focus">True</property>
-	      <property name="position">0</property>
 
 	      <child>
-		<widget class="GtkScrolledWindow" id="scrolledwindow2">
+		<object class="GtkScrolledWindow" id="scrolledwindow2">
 		  <property name="visible">True</property>
 		  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
 		  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
@@ -467,7 +465,7 @@
 		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		  <child>
-		    <widget class="GtkTreeView" id="treeview2">
+		    <object class="GtkTreeView" id="treeview2">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
 		      <property name="has_focus">True</property>
@@ -475,9 +473,9 @@
 		      <property name="rules_hint">False</property>
 		      <property name="reorderable">False</property>
 		      <property name="enable_search">False</property>
-		    </widget>
+		    </object>
 		  </child>
-		</widget>
+		</object>
 		<packing>
 		  <property name="shrink">True</property>
 		  <property name="resize">False</property>
@@ -485,7 +483,7 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkScrolledWindow" id="scrolledwindow3">
+		<object class="GtkScrolledWindow" id="scrolledwindow3">
 		  <property name="visible">True</property>
 		  <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
 		  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
@@ -493,7 +491,7 @@
 		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		  <child>
-		    <widget class="GtkTextView" id="textview3">
+		    <object class="GtkTextView" id="textview3">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
 		      <property name="editable">False</property>
@@ -508,29 +506,29 @@
 		      <property name="left_margin">0</property>
 		      <property name="right_margin">0</property>
 		      <property name="indent">0</property>
-		    </widget>
+		    </object>
 		  </child>
-		</widget>
+		</object>
 		<packing>
 		  <property name="shrink">True</property>
 		  <property name="resize">True</property>
 		</packing>
 	      </child>
-	    </widget>
+	    </object>
 	    <packing>
 	      <property name="shrink">True</property>
 	      <property name="resize">True</property>
 	    </packing>
 	  </child>
-	</widget>
+	</object>
 	<packing>
 	  <property name="padding">0</property>
 	  <property name="expand">True</property>
 	  <property name="fill">True</property>
 	</packing>
       </child>
-    </widget>
+    </object>
   </child>
-</widget>
+</object>
 
-</glade-interface>
+</interface>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 64/66] kconfig: gconf: replace GtkVbox with GtkBox
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (62 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 63/66] kconfig: gconf: migrate to GTK 3 Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 65/66] kconfig: gconf: replace GdkColor with GdkRGBA Masahiro Yamada
                   ` (2 subsequent siblings)
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

GtkVBox is deprecated with GTK 3.2. [1]

Use GtkBox instead.

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/3.2.0/gtk/gtkvbox.c#L47

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.ui | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/gconf.ui b/scripts/kconfig/gconf.ui
index e5dad2b06502..378a3eadf9f8 100644
--- a/scripts/kconfig/gconf.ui
+++ b/scripts/kconfig/gconf.ui
@@ -19,7 +19,8 @@
   <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
 
   <child>
-    <object class="GtkVBox" id="vbox1">
+    <object class="GtkBox" id="vbox1">
+      <property name="orientation">vertical</property>
       <property name="visible">True</property>
       <property name="homogeneous">False</property>
       <property name="spacing">0</property>
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 65/66] kconfig: gconf: replace GdkColor with GdkRGBA
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (63 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 64/66] kconfig: gconf: replace GtkVbox with GtkBox Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-24 15:05 ` [PATCH 66/66] kconfig: gconf: show GTK version in About dialog Masahiro Yamada
  2025-06-30  6:55 ` [PATCH 00/66] kconfig: improve xconfig and gconfig Randy Dunlap
  66 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

GdkColor is deprecated with GTK 3.14. [1]

Use GdkRGBA instead.

This fixes warnings such as:

scripts/kconfig/gconf.c: In function ‘set_node’:
scripts/kconfig/gconf.c:138:9: warning: ‘gdk_color_parse’ is deprecated: Use 'gdk_rgba_parse' instead [-Wdeprecated-declarations]
  138 |         gdk_color_parse(menu_is_visible(menu) ? "Black" : "DarkGray", &color);
      |         ^~~~~~~~~~~~~~~

[1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/3.14.0/gdk/deprecated/gdkcolor.h#L52

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 5959ed255d12..5b1b468e782d 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -125,7 +125,7 @@ static void set_node(GtkTreeStore *tree, GtkTreeIter *node, struct menu *menu)
 	const gchar *_mod = "";
 	const gchar *_yes = "";
 	const gchar *value = "";
-	GdkColor color;
+	GdkRGBA color;
 	gboolean editable = FALSE;
 	gboolean btnvis = FALSE;
 
@@ -135,7 +135,7 @@ static void set_node(GtkTreeStore *tree, GtkTreeIter *node, struct menu *menu)
 				 menu->type == M_COMMENT ? "***" : "",
 				 sym && !sym_has_value(sym) ? "(NEW)" : "");
 
-	gdk_color_parse(menu_is_visible(menu) ? "Black" : "DarkGray", &color);
+	gdk_rgba_parse(&color, menu_is_visible(menu) ? "Black" : "DarkGray");
 
 	if (!sym)
 		goto set;
@@ -1148,7 +1148,7 @@ static void init_left_tree(void)
 				   G_TYPE_STRING, G_TYPE_STRING,
 				   G_TYPE_STRING, G_TYPE_STRING,
 				   G_TYPE_STRING, G_TYPE_STRING,
-				   G_TYPE_POINTER, GDK_TYPE_COLOR,
+				   G_TYPE_POINTER, GDK_TYPE_RGBA,
 				   G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF,
 				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
 				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
@@ -1179,7 +1179,7 @@ static void init_left_tree(void)
 	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
 					    renderer,
 					    "text", COL_OPTION,
-					    "foreground-gdk",
+					    "foreground-rgba",
 					    COL_COLOR, NULL);
 
 	sel = gtk_tree_view_get_selection(view);
@@ -1199,7 +1199,7 @@ static void init_right_tree(void)
 				   G_TYPE_STRING, G_TYPE_STRING,
 				   G_TYPE_STRING, G_TYPE_STRING,
 				   G_TYPE_STRING, G_TYPE_STRING,
-				   G_TYPE_POINTER, GDK_TYPE_COLOR,
+				   G_TYPE_POINTER, GDK_TYPE_RGBA,
 				   G_TYPE_BOOLEAN, GDK_TYPE_PIXBUF,
 				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
 				   G_TYPE_BOOLEAN, G_TYPE_BOOLEAN,
@@ -1237,32 +1237,32 @@ static void init_right_tree(void)
 	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
 					    renderer,
 					    "text", COL_OPTION,
-					    "foreground-gdk",
+					    "foreground-rgba",
 					    COL_COLOR, NULL);
 
 	renderer = gtk_cell_renderer_text_new();
 	gtk_tree_view_insert_column_with_attributes(view, -1,
 						    "Name", renderer,
 						    "text", COL_NAME,
-						    "foreground-gdk",
+						    "foreground-rgba",
 						    COL_COLOR, NULL);
 	renderer = gtk_cell_renderer_text_new();
 	gtk_tree_view_insert_column_with_attributes(view, -1,
 						    "N", renderer,
 						    "text", COL_NO,
-						    "foreground-gdk",
+						    "foreground-rgba",
 						    COL_COLOR, NULL);
 	renderer = gtk_cell_renderer_text_new();
 	gtk_tree_view_insert_column_with_attributes(view, -1,
 						    "M", renderer,
 						    "text", COL_MOD,
-						    "foreground-gdk",
+						    "foreground-rgba",
 						    COL_COLOR, NULL);
 	renderer = gtk_cell_renderer_text_new();
 	gtk_tree_view_insert_column_with_attributes(view, -1,
 						    "Y", renderer,
 						    "text", COL_YES,
-						    "foreground-gdk",
+						    "foreground-rgba",
 						    COL_COLOR, NULL);
 	renderer = gtk_cell_renderer_text_new();
 	gtk_tree_view_insert_column_with_attributes(view, -1,
@@ -1270,7 +1270,7 @@ static void init_right_tree(void)
 						    "text", COL_VALUE,
 						    "editable",
 						    COL_EDIT,
-						    "foreground-gdk",
+						    "foreground-rgba",
 						    COL_COLOR, NULL);
 	g_signal_connect(G_OBJECT(renderer), "edited",
 			 G_CALLBACK(renderer_edited), tree2_w);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* [PATCH 66/66] kconfig: gconf: show GTK version in About dialog
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (64 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 65/66] kconfig: gconf: replace GdkColor with GdkRGBA Masahiro Yamada
@ 2025-06-24 15:05 ` Masahiro Yamada
  2025-06-30  6:06   ` Randy Dunlap
  2025-06-30  6:55 ` [PATCH 00/66] kconfig: improve xconfig and gconfig Randy Dunlap
  66 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-24 15:05 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

Likewise xconfig, it is useful to display the GTK version in the About
dialog.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/gconf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 5b1b468e782d..7340407e4d6e 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -579,7 +579,11 @@ static void on_about1_activate(GtkMenuItem *menuitem, gpointer user_data)
 	dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
 					GTK_DIALOG_DESTROY_WITH_PARENT,
 					GTK_MESSAGE_INFO,
-					GTK_BUTTONS_CLOSE, "%s", about_text);
+					GTK_BUTTONS_CLOSE, "%s\nGTK version: %d.%d.%d",
+					about_text,
+					gtk_get_major_version(),
+					gtk_get_minor_version(),
+					gtk_get_micro_version());
 	gtk_dialog_run(GTK_DIALOG(dialog));
 	gtk_widget_destroy(dialog);
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 104+ messages in thread

* Re: [PATCH 52/66] kconfig: gconf: remove fixup_rootmenu()
  2025-06-24 15:05 ` [PATCH 52/66] kconfig: gconf: remove fixup_rootmenu() Masahiro Yamada
@ 2025-06-27 12:46   ` Masahiro Yamada
  0 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-27 12:46 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel

On Wed, Jun 25, 2025 at 12:09 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> The MENU_ROOT flag is a hack used for SPLIT_VIEW mode. Top-level symbols
> have no parent menu, so they are displayed directly in the left pane.
>
> Show the rootmenu, allowing top-level symbols to have a proper parent
> menu and be displayed consistently in the right pane.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---

I will drop this.

This does not work when a menu is created under a non-menu entry.

e.g.)

config A
        bool "A"

if A

menu "menu"

config B
        bool "B"

endmenu

endif




-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 53/66] kconfig: gconf: use size_allocate event handler
  2025-06-24 15:05 ` [PATCH 53/66] kconfig: gconf: use size_allocate event handler Masahiro Yamada
@ 2025-06-29 17:56   ` Masahiro Yamada
  2025-06-30  5:23     ` Randy Dunlap
  0 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-29 17:56 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel

On Wed, Jun 25, 2025 at 12:09 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> The size_request event is not available in GTK 3. Use the size_allocate
> event handler instead.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---

This has a regression - with this, we cannot move
the horizontal separator between in the right pane.

I will use the "configure-event" event instead.

>
>  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
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 02/66] kconfig: qconf: do not show checkbox icon for choice
  2025-06-24 15:04 ` [PATCH 02/66] kconfig: qconf: do not show checkbox icon for choice Masahiro Yamada
@ 2025-06-29 20:15   ` Randy Dunlap
  2025-06-30  3:36     ` Masahiro Yamada
  2025-06-30  0:51   ` Randy Dunlap
  1 sibling, 1 reply; 104+ messages in thread
From: Randy Dunlap @ 2025-06-29 20:15 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> When you select "Show All Options" or "Show Prompt Options", choice
> entries display a check box icon, but this has no point because
> choice is always y since commit

                     since commit _____________________.

> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  scripts/kconfig/qconf.cc | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> index eaa465b0ccf9..546738a5c3b1 100644
> --- a/scripts/kconfig/qconf.cc
> +++ b/scripts/kconfig/qconf.cc
> @@ -92,7 +92,6 @@ void ConfigItem::updateMenu(void)
>  {
>  	ConfigList* list;
>  	struct symbol* sym;
> -	struct property *prop;
>  	QString prompt;
>  	int type;
>  	tristate expr;
> @@ -105,11 +104,10 @@ void ConfigItem::updateMenu(void)
>  	}
>  
>  	sym = menu->sym;
> -	prop = menu->prompt;
>  	prompt = menu_get_prompt(menu);
>  
> -	if (prop) switch (prop->type) {
> -	case P_MENU:
> +	switch (menu->type) {
> +	case M_MENU:
>  		if (list->mode == singleMode) {
>  			/* a menuconfig entry is displayed differently
>  			 * depending whether it's at the view root or a child.
> @@ -123,10 +121,13 @@ void ConfigItem::updateMenu(void)
>  			setIcon(promptColIdx, QIcon());
>  		}
>  		goto set_prompt;
> -	case P_COMMENT:
> +	case M_COMMENT:
>  		setIcon(promptColIdx, QIcon());
>  		prompt = "*** " + prompt + " ***";
>  		goto set_prompt;
> +	case M_CHOICE:
> +		setIcon(promptColIdx, QIcon());
> +		goto set_prompt;
>  	default:
>  		;
>  	}

-- 
~Randy


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 02/66] kconfig: qconf: do not show checkbox icon for choice
  2025-06-24 15:04 ` [PATCH 02/66] kconfig: qconf: do not show checkbox icon for choice Masahiro Yamada
  2025-06-29 20:15   ` Randy Dunlap
@ 2025-06-30  0:51   ` Randy Dunlap
  2025-06-30  0:54     ` Randy Dunlap
  1 sibling, 1 reply; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  0:51 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel

Hi,

On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> When you select "Show All Options" or "Show Prompt Options", choice
> entries display a check box icon, but this has no point because
> choice is always y since commit
> 

I don't see a check box icon beside the choice entries either before
or after this change. Or do you mean a Radio Button?

(setup: make defconfig for x86_64 in 2 subdirs, one pre-patches
named X64, one post-patches named xx64.)

Enable Show Prompt Options for both testing windows.

E.g., under "Processor types and features", scroll down on the right side
to "TSX enable mode". Under it in each in pre-patches and post-patches,
I see buttons to choose which TSX enable mode to select. They look the
same both pre-patch and post-patch.

What am I missing?


> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  scripts/kconfig/qconf.cc | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> index eaa465b0ccf9..546738a5c3b1 100644
> --- a/scripts/kconfig/qconf.cc
> +++ b/scripts/kconfig/qconf.cc
> @@ -92,7 +92,6 @@ void ConfigItem::updateMenu(void)
>  {
>  	ConfigList* list;
>  	struct symbol* sym;
> -	struct property *prop;
>  	QString prompt;
>  	int type;
>  	tristate expr;
> @@ -105,11 +104,10 @@ void ConfigItem::updateMenu(void)
>  	}
>  
>  	sym = menu->sym;
> -	prop = menu->prompt;
>  	prompt = menu_get_prompt(menu);
>  
> -	if (prop) switch (prop->type) {
> -	case P_MENU:
> +	switch (menu->type) {
> +	case M_MENU:
>  		if (list->mode == singleMode) {
>  			/* a menuconfig entry is displayed differently
>  			 * depending whether it's at the view root or a child.
> @@ -123,10 +121,13 @@ void ConfigItem::updateMenu(void)
>  			setIcon(promptColIdx, QIcon());
>  		}
>  		goto set_prompt;
> -	case P_COMMENT:
> +	case M_COMMENT:
>  		setIcon(promptColIdx, QIcon());
>  		prompt = "*** " + prompt + " ***";
>  		goto set_prompt;
> +	case M_CHOICE:
> +		setIcon(promptColIdx, QIcon());
> +		goto set_prompt;
>  	default:
>  		;
>  	}

Thanks.
-- 
~Randy


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 02/66] kconfig: qconf: do not show checkbox icon for choice
  2025-06-30  0:51   ` Randy Dunlap
@ 2025-06-30  0:54     ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  0:54 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/29/25 5:51 PM, Randy Dunlap wrote:
> Hi,
> 
> On 6/24/25 8:04 AM, Masahiro Yamada wrote:
>> When you select "Show All Options" or "Show Prompt Options", choice
>> entries display a check box icon, but this has no point because
>> choice is always y since commit
>>
> 
> I don't see a check box icon beside the choice entries either before
> or after this change. Or do you mean a Radio Button?
> 
> (setup: make defconfig for x86_64 in 2 subdirs, one pre-patches
> named X64, one post-patches named xx64.)
> 
> Enable Show Prompt Options for both testing windows.
> 
> E.g., under "Processor types and features", scroll down on the right side
> to "TSX enable mode". Under it in each in pre-patches and post-patches,
> I see buttons to choose which TSX enable mode to select. They look the
> same both pre-patch and post-patch.
> 
> What am I missing?
> 

Yep, user error. I didn't back out the patches to build xconfig.  :(
My bad.


Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> 
>> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>> ---
>>
>>  scripts/kconfig/qconf.cc | 11 ++++++-----
>>  1 file changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
>> index eaa465b0ccf9..546738a5c3b1 100644
>> --- a/scripts/kconfig/qconf.cc
>> +++ b/scripts/kconfig/qconf.cc
>> @@ -92,7 +92,6 @@ void ConfigItem::updateMenu(void)
>>  {
>>  	ConfigList* list;
>>  	struct symbol* sym;
>> -	struct property *prop;
>>  	QString prompt;
>>  	int type;
>>  	tristate expr;
>> @@ -105,11 +104,10 @@ void ConfigItem::updateMenu(void)
>>  	}
>>  
>>  	sym = menu->sym;
>> -	prop = menu->prompt;
>>  	prompt = menu_get_prompt(menu);
>>  
>> -	if (prop) switch (prop->type) {
>> -	case P_MENU:
>> +	switch (menu->type) {
>> +	case M_MENU:
>>  		if (list->mode == singleMode) {
>>  			/* a menuconfig entry is displayed differently
>>  			 * depending whether it's at the view root or a child.
>> @@ -123,10 +121,13 @@ void ConfigItem::updateMenu(void)
>>  			setIcon(promptColIdx, QIcon());
>>  		}
>>  		goto set_prompt;
>> -	case P_COMMENT:
>> +	case M_COMMENT:
>>  		setIcon(promptColIdx, QIcon());
>>  		prompt = "*** " + prompt + " ***";
>>  		goto set_prompt;
>> +	case M_CHOICE:
>> +		setIcon(promptColIdx, QIcon());
>> +		goto set_prompt;
>>  	default:
>>  		;
>>  	}
> 
> Thanks.

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 03/66] kconfig: qconf: show selected choice in the Value column
  2025-06-24 15:04 ` [PATCH 03/66] kconfig: qconf: show selected choice in the Value column Masahiro Yamada
@ 2025-06-30  0:56   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  0:56 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> It is useful to display the selected choice's value in the Value column.

(instead of 'N', useless)


Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>

Nice, thanks.

> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  scripts/kconfig/qconf.cc | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> index 546738a5c3b1..68640e507ec4 100644
> --- a/scripts/kconfig/qconf.cc
> +++ b/scripts/kconfig/qconf.cc
> @@ -127,6 +127,9 @@ void ConfigItem::updateMenu(void)
>  		goto set_prompt;
>  	case M_CHOICE:
>  		setIcon(promptColIdx, QIcon());
> +		sym = sym_calc_choice(menu);
> +		if (sym)
> +			setText(dataColIdx, sym->name);
>  		goto set_prompt;
>  	default:
>  		;
> @@ -189,7 +192,11 @@ void ConfigItem::testUpdateMenu(void)
>  	if (!menu)
>  		return;
>  
> -	sym_calc_value(menu->sym);
> +	if (menu->type == M_CHOICE)
> +		sym_calc_choice(menu);
> +	else
> +		sym_calc_value(menu->sym);
> +
>  	if (menu->flags & MENU_CHANGED) {
>  		/* the menu entry changed, so update all list items */
>  		menu->flags &= ~MENU_CHANGED;

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 04/66] kconfig: rename menu_get_parent_menu() to menu_get_menu_or_parent_menu()
  2025-06-24 15:04 ` [PATCH 04/66] kconfig: rename menu_get_parent_menu() to menu_get_menu_or_parent_menu() Masahiro Yamada
@ 2025-06-30  0:58   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  0:58 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> The current menu_get_parent_menu() does not always return the parent
> menu; if the given argument is itself a menu, it returns that menu.
> 
> Rename this function to better reflect this behavior.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> ---
> 
>  scripts/kconfig/conf.c   | 2 +-
>  scripts/kconfig/lkc.h    | 2 +-
>  scripts/kconfig/menu.c   | 8 +++++++-
>  scripts/kconfig/qconf.cc | 6 +++---
>  4 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
> index 8abe57041955..a7b44cd8ae14 100644
> --- a/scripts/kconfig/conf.c
> +++ b/scripts/kconfig/conf.c
> @@ -594,7 +594,7 @@ static void check_conf(struct menu *menu)
>  		default:
>  			if (!conf_cnt++)
>  				printf("*\n* Restart config...\n*\n");
> -			rootEntry = menu_get_parent_menu(menu);
> +			rootEntry = menu_get_menu_or_parent_menu(menu);
>  			conf(rootEntry);
>  			break;
>  		}
> diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
> index fbc907f75eac..5cc85c3d4aaa 100644
> --- a/scripts/kconfig/lkc.h
> +++ b/scripts/kconfig/lkc.h
> @@ -97,7 +97,7 @@ bool menu_is_empty(struct menu *menu);
>  bool menu_is_visible(struct menu *menu);
>  bool menu_has_prompt(const struct menu *menu);
>  const char *menu_get_prompt(const struct menu *menu);
> -struct menu *menu_get_parent_menu(struct menu *menu);
> +struct menu *menu_get_menu_or_parent_menu(struct menu *menu);
>  int get_jump_key_char(void);
>  struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head);
>  void menu_get_ext_help(struct menu *menu, struct gstr *help);
> diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
> index 7d48a692bd27..ccb690bbf05d 100644
> --- a/scripts/kconfig/menu.c
> +++ b/scripts/kconfig/menu.c
> @@ -575,7 +575,13 @@ const char *menu_get_prompt(const struct menu *menu)
>  	return NULL;
>  }
>  
> -struct menu *menu_get_parent_menu(struct menu *menu)
> +/**
> + * menu_get_menu_or_parent_menu - return the parent menu or the menu itself
> + * @menu: pointer to the menu
> + * return: the parent menu. If the given argument is already a menu, return
> + *         itself.
> + */
> +struct menu *menu_get_menu_or_parent_menu(struct menu *menu)
>  {
>  	enum prop_type type;
>  
> diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> index 68640e507ec4..dc056b0a8fde 100644
> --- a/scripts/kconfig/qconf.cc
> +++ b/scripts/kconfig/qconf.cc
> @@ -577,7 +577,7 @@ void ConfigList::setParentMenu(void)
>  	oldroot = rootEntry;
>  	if (rootEntry == &rootmenu)
>  		return;
> -	setRootMenu(menu_get_parent_menu(rootEntry->parent));
> +	setRootMenu(menu_get_menu_or_parent_menu(rootEntry->parent));
>  
>  	QTreeWidgetItemIterator it(this);
>  	while (*it) {
> @@ -1540,7 +1540,7 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
>  	switch (configList->mode) {
>  	case singleMode:
>  		list = configList;
> -		parent = menu_get_parent_menu(menu);
> +		parent = menu_get_menu_or_parent_menu(menu);
>  		if (!parent)
>  			return;
>  		list->setRootMenu(parent);
> @@ -1551,7 +1551,7 @@ void ConfigMainWindow::setMenuLink(struct menu *menu)
>  			configList->clearSelection();
>  			list = configList;
>  		} else {
> -			parent = menu_get_parent_menu(menu->parent);
> +			parent = menu_get_menu_or_parent_menu(menu->parent);
>  			if (!parent)
>  				return;
>  

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 05/66] kconfig: re-add menu_get_parent_menu() that returns parent menu
  2025-06-24 15:04 ` [PATCH 05/66] kconfig: re-add menu_get_parent_menu() that returns parent menu Masahiro Yamada
@ 2025-06-30  0:59   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  0:59 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> This helper returns the parent menu, or NULL if there is no parent.
> The main difference from the previous version is that it always returns
> the parent menu even when the given argument is itself a menu.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>


> ---
> 
>  scripts/kconfig/lkc.h  |  1 +
>  scripts/kconfig/menu.c | 14 ++++++++++++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
> index 5cc85c3d4aaa..37b606c74bff 100644
> --- a/scripts/kconfig/lkc.h
> +++ b/scripts/kconfig/lkc.h
> @@ -97,6 +97,7 @@ bool menu_is_empty(struct menu *menu);
>  bool menu_is_visible(struct menu *menu);
>  bool menu_has_prompt(const struct menu *menu);
>  const char *menu_get_prompt(const struct menu *menu);
> +struct menu *menu_get_parent_menu(struct menu *menu);
>  struct menu *menu_get_menu_or_parent_menu(struct menu *menu);
>  int get_jump_key_char(void);
>  struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head);
> diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
> index ccb690bbf05d..a5e5b4fdcd93 100644
> --- a/scripts/kconfig/menu.c
> +++ b/scripts/kconfig/menu.c
> @@ -575,6 +575,20 @@ const char *menu_get_prompt(const struct menu *menu)
>  	return NULL;
>  }
>  
> +/**
> + * menu_get_parent_menu - return the parent menu or NULL
> + * @menu: pointer to the menu
> + * return: the parent menu, or NULL if there is no parent.
> + */
> +struct menu *menu_get_parent_menu(struct menu *menu)
> +{
> +	for (menu = menu->parent; menu; menu = menu->parent)
> +		if (menu->type == M_MENU)
> +			return menu;
> +
> +	return NULL;
> +}
> +
>  /**
>   * menu_get_menu_or_parent_menu - return the parent menu or the menu itself
>   * @menu: pointer to the menu

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 06/66] kconfig: gconf: make columns resizable
  2025-06-24 15:04 ` [PATCH 06/66] kconfig: gconf: make columns resizable Masahiro Yamada
@ 2025-06-30  2:18   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  2:18 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> The variable "resizeable" is a typo and always set to FALSE, resulting
> in dead code in init_right_tree(). It is unclear column resizing should
> be disabled. Enable it.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Looks good.

Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>

> ---
> 
>  scripts/kconfig/gconf.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index c0f46f189060..a3978d3420d1 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -30,7 +30,6 @@ static gint view_mode = FULL_VIEW;
>  static gboolean show_name = TRUE;
>  static gboolean show_range = TRUE;
>  static gboolean show_value = TRUE;
> -static gboolean resizeable = FALSE;
>  static int opt_mode = OPT_NORMAL;
>  
>  GtkWidget *main_wnd = NULL;
> @@ -312,11 +311,9 @@ static void init_right_tree(void)
>  	column = gtk_tree_view_get_column(view, COL_VALUE);
>  	gtk_tree_view_column_set_visible(column, show_value);
>  
> -	if (resizeable) {
> -		for (i = 0; i < COL_VALUE; i++) {
> -			column = gtk_tree_view_get_column(view, i);
> -			gtk_tree_view_column_set_resizable(column, TRUE);
> -		}
> +	for (i = 0; i < COL_VALUE; i++) {
> +		column = gtk_tree_view_get_column(view, i);
> +		gtk_tree_view_column_set_resizable(column, TRUE);
>  	}
>  
>  	sel = gtk_tree_view_get_selection(view);

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 07/66] kconfig: gconf: fix potential memory leak in renderer_edited()
  2025-06-24 15:04 ` [PATCH 07/66] kconfig: gconf: fix potential memory leak in renderer_edited() Masahiro Yamada
@ 2025-06-30  2:21   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  2:21 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> If gtk_tree_model_get_iter() fails, gtk_tree_path_free() is not called.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>

> ---
> 
>  scripts/kconfig/gconf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index a3978d3420d1..769f38307f34 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -745,7 +745,7 @@ static void renderer_edited(GtkCellRendererText * cell,
>  	struct symbol *sym;
>  
>  	if (!gtk_tree_model_get_iter(model2, &iter, path))
> -		return;
> +		goto free;
>  
>  	gtk_tree_model_get(model2, &iter, COL_MENU, &menu, -1);
>  	sym = menu->sym;
> @@ -757,6 +757,7 @@ static void renderer_edited(GtkCellRendererText * cell,
>  
>  	update_tree(&rootmenu, NULL);
>  
> +free:
>  	gtk_tree_path_free(path);
>  }
>  

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 08/66] kconfig: gconf: always destroy dialog in on_window1_delete_event()
  2025-06-24 15:04 ` [PATCH 08/66] kconfig: gconf: always destroy dialog in on_window1_delete_event() Masahiro Yamada
@ 2025-06-30  2:23   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  2:23 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> When gtk_dialog_run() returns GTK_RESPONSE_YES or GTK_RESPONSE_NO,
> gtk_widget_destroy() is not called, resulting is a memory leak.
> 
> It is better to always destroy the dialog, even if the application
> is about to exit.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>

> ---
> 
>  scripts/kconfig/gconf.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index 769f38307f34..52d439a5119b 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -378,6 +378,7 @@ gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event,
>  {
>  	GtkWidget *dialog, *label;
>  	gint result;
> +	gint ret = FALSE;
>  
>  	if (!conf_get_changed())
>  		return FALSE;
> @@ -404,17 +405,19 @@ gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event,
>  	switch (result) {
>  	case GTK_RESPONSE_YES:
>  		on_save_activate(NULL, NULL);
> -		return FALSE;
> +		break;
>  	case GTK_RESPONSE_NO:
> -		return FALSE;
> +		break;
>  	case GTK_RESPONSE_CANCEL:
>  	case GTK_RESPONSE_DELETE_EVENT:
>  	default:
> -		gtk_widget_destroy(dialog);
> -		return TRUE;
> +		ret = TRUE;
> +		break;
>  	}
>  
> -	return FALSE;
> +	gtk_widget_destroy(dialog);
> +
> +	return ret;
>  }
>  
>  

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 10/66] kconfig: gconf: remove empty if-block
  2025-06-24 15:04 ` [PATCH 10/66] kconfig: gconf: remove empty if-block Masahiro Yamada
@ 2025-06-30  2:25   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  2:25 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> This if-block is empty.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>

> ---
> 
>  scripts/kconfig/gconf.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index b2a0208b0a5f..7960c456e3b9 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -913,8 +913,6 @@ on_treeview2_key_press_event(GtkWidget * widget,
>  			gtk_tree_view_expand_row(view, path, FALSE);
>  		return TRUE;
>  	}
> -	if (event->keyval == GDK_KP_Enter) {
> -	}
>  	if (widget == tree1_w)
>  		return FALSE;
>  

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 11/66] kconfig: gconf: remove meaningless code in init_main_window()
  2025-06-24 15:04 ` [PATCH 11/66] kconfig: gconf: remove meaningless code in init_main_window() Masahiro Yamada
@ 2025-06-30  2:25   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  2:25 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> The 'widget' variable is set, but not used in later code.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>

> ---
> 
>  scripts/kconfig/gconf.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index 7960c456e3b9..4b5befa4f685 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -129,7 +129,6 @@ static void init_main_window(const gchar *glade_file)
>  	conf_set_changed_callback(conf_changed);
>  
>  	style = gtk_widget_get_style(main_wnd);
> -	widget = glade_xml_get_widget(xml, "toolbar1");
>  
>  	replace_button_icon(xml, main_wnd->window, style,
>  			    "button4", (gchar **) xpm_single_view);

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 21/66] kconfig: gconf: remove unneeded variables in on_treeview*_button_press_event()
  2025-06-24 15:05 ` [PATCH 21/66] kconfig: gconf: remove unneeded variables in on_treeview*_button_press_event() Masahiro Yamada
@ 2025-06-30  2:40   ` Randy Dunlap
  2025-06-30  4:22     ` Masahiro Yamada
  0 siblings, 1 reply; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  2:40 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> No all position parameters are used here. Passing NULL to

  Not all

> gtk_tree_view_get_cursor() or gtk_tree_view_get_path_at_pos() is
> allowed. [1] [2]
> 
> [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12638
> [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12795
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  scripts/kconfig/gconf.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 25/66] kconfig: gconf: refactor view setting code
  2025-06-24 15:05 ` [PATCH 25/66] kconfig: gconf: refactor view setting code Masahiro Yamada
@ 2025-06-30  2:51   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  2:51 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> Factor out common code for setting the view into a new function,
> set_view_mode().
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Nice cleanup.

Acked-by: Randy Dunlap <rdunlap@infradead.org>


> ---
> 
>  scripts/kconfig/gconf.c | 74 +++++++++++++++++++++--------------------
>  1 file changed, 38 insertions(+), 36 deletions(-)

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 26/66] kconfig: gconf: grey out button for current view
  2025-06-24 15:05 ` [PATCH 26/66] kconfig: gconf: grey out button for current view Masahiro Yamada
@ 2025-06-30  2:53   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  2:53 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> This clarifies which view is currently selected.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Looks good.


Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>

> ---
> 
>  scripts/kconfig/gconf.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index b67ebff3f288..67c5c965aaf8 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -38,8 +38,7 @@ static GtkWidget *tree2_w;	// right frame
>  static GtkWidget *text_w;
>  static GtkWidget *hpaned;
>  static GtkWidget *vpaned;
> -static GtkWidget *back_btn;
> -static GtkWidget *save_btn;
> +static GtkWidget *back_btn, *save_btn, *single_btn, *split_btn, *full_btn;
>  static GtkWidget *save_menu_item;
>  
>  static GtkTextTag *tag1, *tag2;
> @@ -85,18 +84,25 @@ static void set_view_mode(enum view_mode mode)
>  		gtk_paned_set_position(GTK_PANED(hpaned), 0);
>  	}
>  
> +	gtk_widget_set_sensitive(single_btn, TRUE);
> +	gtk_widget_set_sensitive(split_btn, TRUE);
> +	gtk_widget_set_sensitive(full_btn, TRUE);
> +
>  	switch (mode) {
>  	case SINGLE_VIEW:
>  		current = &rootmenu;
>  		display_tree_part();
> +		gtk_widget_set_sensitive(single_btn, FALSE);
>  		break;
>  	case SPLIT_VIEW:
>  		gtk_tree_store_clear(tree2);
>  		display_list();
> +		gtk_widget_set_sensitive(split_btn, FALSE);
>  		break;
>  	case FULL_VIEW:
>  		gtk_tree_store_clear(tree2);
>  		display_tree(&rootmenu);
> +		gtk_widget_set_sensitive(full_btn, FALSE);
>  		break;
>  	}
>  
> @@ -1167,10 +1173,15 @@ static void init_main_window(const gchar *glade_file)
>  
>  	style = gtk_widget_get_style(main_wnd);
>  
> +	single_btn = glade_xml_get_widget(xml, "button4");
>  	replace_button_icon(xml, main_wnd->window, style,
>  			    "button4", (gchar **) xpm_single_view);
> +
> +	split_btn = glade_xml_get_widget(xml, "button5");
>  	replace_button_icon(xml, main_wnd->window, style,
>  			    "button5", (gchar **) xpm_split_view);
> +
> +	full_btn = glade_xml_get_widget(xml, "button6");
>  	replace_button_icon(xml, main_wnd->window, style,
>  			    "button6", (gchar **) xpm_tree_view);
>  

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 29/66] kconfig: gconf: add static qualifiers to event handlers
  2025-06-24 15:05 ` [PATCH 29/66] kconfig: gconf: add static qualifiers to event handlers Masahiro Yamada
@ 2025-06-30  2:55   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  2:55 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> This fixes several -Wmissing-prototypes warnings.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>

> ---
> 
>  scripts/kconfig/gconf.c     | 173 +++++++++++++++++++++++++-----------
>  scripts/kconfig/gconf.glade |  30 -------
>  2 files changed, 120 insertions(+), 83 deletions(-)
> 
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index bed4c86c2085..02bbb7ce4c4a 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -172,7 +172,7 @@ load_filename(GtkFileSelection * file_selector, gpointer user_data)
>  		display_tree_part();
>  }
>  
> -void on_load1_activate(GtkMenuItem * menuitem, gpointer user_data)
> +static void on_load1_activate(GtkMenuItem *menuitem, gpointer user_data)
>  {
>  	GtkWidget *fs;
>  
> @@ -191,8 +191,7 @@ void on_load1_activate(GtkMenuItem * menuitem, gpointer user_data)
>  	gtk_widget_show(fs);
>  }
>  
> -
> -void on_save_activate(GtkMenuItem * menuitem, gpointer user_data)
> +static void on_save_activate(GtkMenuItem *menuitem, gpointer user_data)
>  {
>  	if (conf_write(NULL))
>  		text_insert_msg("Error", "Unable to save configuration !");
> @@ -214,7 +213,7 @@ store_filename(GtkFileSelection * file_selector, gpointer user_data)
>  	gtk_widget_destroy(GTK_WIDGET(user_data));
>  }
>  
> -void on_save_as1_activate(GtkMenuItem * menuitem, gpointer user_data)
> +static void on_save_as1_activate(GtkMenuItem *menuitem, gpointer user_data)
>  {
>  	GtkWidget *fs;
>  
> @@ -233,7 +232,7 @@ void on_save_as1_activate(GtkMenuItem * menuitem, gpointer user_data)
>  	gtk_widget_show(fs);
>  }
>  
> -void on_show_name1_activate(GtkMenuItem * menuitem, gpointer user_data)
> +static void on_show_name1_activate(GtkMenuItem *menuitem, gpointer user_data)
>  {
>  	GtkTreeViewColumn *col;
>  
> @@ -243,8 +242,7 @@ void on_show_name1_activate(GtkMenuItem * menuitem, gpointer user_data)
>  		gtk_tree_view_column_set_visible(col, show_name);
>  }
>  
> -
> -void on_show_range1_activate(GtkMenuItem * menuitem, gpointer user_data)
> +static void on_show_range1_activate(GtkMenuItem *menuitem, gpointer user_data)
>  {
>  	GtkTreeViewColumn *col;
>  
> @@ -261,8 +259,7 @@ void on_show_range1_activate(GtkMenuItem * menuitem, gpointer user_data)
>  
>  }
>  
> -
> -void on_show_data1_activate(GtkMenuItem * menuitem, gpointer user_data)
> +static void on_show_data1_activate(GtkMenuItem *menuitem, gpointer user_data)
>  {
>  	GtkTreeViewColumn *col;
>  
> @@ -272,35 +269,31 @@ void on_show_data1_activate(GtkMenuItem * menuitem, gpointer user_data)
>  		gtk_tree_view_column_set_visible(col, show_value);
>  }
>  
> -
> -void
> -on_set_option_mode1_activate(GtkMenuItem *menuitem, gpointer user_data)
> +static void on_set_option_mode1_activate(GtkMenuItem *menuitem,
> +					 gpointer user_data)
>  {
>  	opt_mode = OPT_NORMAL;
>  	gtk_tree_store_clear(tree2);
>  	display_tree(&rootmenu);	/* instead of update_tree to speed-up */
>  }
>  
> -
> -void
> -on_set_option_mode2_activate(GtkMenuItem *menuitem, gpointer user_data)
> +static void on_set_option_mode2_activate(GtkMenuItem *menuitem,
> +					 gpointer user_data)
>  {
>  	opt_mode = OPT_ALL;
>  	gtk_tree_store_clear(tree2);
>  	display_tree(&rootmenu);	/* instead of update_tree to speed-up */
>  }
>  
> -
> -void
> -on_set_option_mode3_activate(GtkMenuItem *menuitem, gpointer user_data)
> +static void on_set_option_mode3_activate(GtkMenuItem *menuitem,
> +					 gpointer user_data)
>  {
>  	opt_mode = OPT_PROMPT;
>  	gtk_tree_store_clear(tree2);
>  	display_tree(&rootmenu);	/* instead of update_tree to speed-up */
>  }
>  
> -
> -void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data)
> +static void on_introduction1_activate(GtkMenuItem *menuitem, gpointer user_data)
>  {
>  	GtkWidget *dialog;
>  	const gchar *intro_text =
> @@ -327,8 +320,7 @@ void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data)
>  	gtk_widget_show_all(dialog);
>  }
>  
> -
> -void on_about1_activate(GtkMenuItem * menuitem, gpointer user_data)
> +static void on_about1_activate(GtkMenuItem *menuitem, gpointer user_data)
>  {
>  	GtkWidget *dialog;
>  	const gchar *about_text =
> @@ -345,8 +337,7 @@ void on_about1_activate(GtkMenuItem * menuitem, gpointer user_data)
>  	gtk_widget_show_all(dialog);
>  }
>  
> -
> -void on_license1_activate(GtkMenuItem * menuitem, gpointer user_data)
> +static void on_license1_activate(GtkMenuItem *menuitem, gpointer user_data)
>  {
>  	GtkWidget *dialog;
>  	const gchar *license_text =
> @@ -364,8 +355,8 @@ void on_license1_activate(GtkMenuItem * menuitem, gpointer user_data)
>  	gtk_widget_show_all(dialog);
>  }
>  
> -
> -void on_back_clicked(GtkButton * button, gpointer user_data)
> +/* toolbar handlers */
> +static void on_back_clicked(GtkButton *button, gpointer user_data)
>  {
>  	enum prop_type ptype;
>  
> @@ -379,50 +370,44 @@ void on_back_clicked(GtkButton * button, gpointer user_data)
>  		gtk_widget_set_sensitive(back_btn, FALSE);
>  }
>  
> -
> -void on_load_clicked(GtkButton * button, gpointer user_data)
> +static void on_load_clicked(GtkButton *button, gpointer user_data)
>  {
>  	on_load1_activate(NULL, user_data);
>  }
>  
> -
> -void on_single_clicked(GtkButton * button, gpointer user_data)
> +static void on_single_clicked(GtkButton *button, gpointer user_data)
>  {
>  	set_view_mode(SINGLE_VIEW);
>  }
>  
> -
> -void on_split_clicked(GtkButton * button, gpointer user_data)
> +static void on_split_clicked(GtkButton *button, gpointer user_data)
>  {
>  	set_view_mode(SPLIT_VIEW);
>  }
>  
> -
> -void on_full_clicked(GtkButton * button, gpointer user_data)
> +static void on_full_clicked(GtkButton *button, gpointer user_data)
>  {
>  	set_view_mode(FULL_VIEW);
>  }
>  
> -
> -void on_collapse_clicked(GtkButton * button, gpointer user_data)
> +static void on_collapse_clicked(GtkButton *button, gpointer user_data)
>  {
>  	gtk_tree_view_collapse_all(GTK_TREE_VIEW(tree2_w));
>  }
>  
> -
> -void on_expand_clicked(GtkButton * button, gpointer user_data)
> +static void on_expand_clicked(GtkButton *button, gpointer user_data)
>  {
>  	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w));
>  }
>  
>  /* Main Windows Callbacks */
>  
> -void on_window1_destroy(GtkObject *object, gpointer user_data)
> +static void on_window1_destroy(GtkObject *object, gpointer user_data)
>  {
>  	gtk_main_quit();
>  }
>  
> -void on_window1_size_request(GtkWidget *widget,
> +static void on_window1_size_request(GtkWidget *widget,
>  				    GtkRequisition *requisition,
>  				    gpointer user_data)
>  {
> @@ -441,7 +426,7 @@ void on_window1_size_request(GtkWidget *widget,
>  	gtk_paned_set_position(GTK_PANED(vpaned), 2 * h / 3);
>  }
>  
> -gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
> +static gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
>  					gpointer user_data)
>  {
>  	GtkWidget *dialog, *label;
> @@ -488,7 +473,7 @@ gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
>  	return ret;
>  }
>  
> -void on_quit1_activate(GtkMenuItem *menuitem, gpointer user_data)
> +static void on_quit1_activate(GtkMenuItem *menuitem, gpointer user_data)
>  {
>  	if (!on_window1_delete_event(NULL, NULL, NULL))
>  		gtk_widget_destroy(GTK_WIDGET(main_wnd));
> @@ -598,9 +583,9 @@ static gint column2index(GtkTreeViewColumn * column)
>  
>  
>  /* User click: update choice (full) or goes down (single) */
> -gboolean
> -on_treeview2_button_press_event(GtkWidget * widget,
> -				GdkEventButton * event, gpointer user_data)
> +static gboolean on_treeview2_button_press_event(GtkWidget *widget,
> +						GdkEventButton *event,
> +						gpointer user_data)
>  {
>  	GtkTreeView *view = GTK_TREE_VIEW(widget);
>  	GtkTreePath *path;
> @@ -648,9 +633,9 @@ on_treeview2_button_press_event(GtkWidget * widget,
>  }
>  
>  /* Key pressed: update choice */
> -gboolean
> -on_treeview2_key_press_event(GtkWidget * widget,
> -			     GdkEventKey * event, gpointer user_data)
> +static gboolean on_treeview2_key_press_event(GtkWidget *widget,
> +					     GdkEventKey *event,
> +					     gpointer user_data)
>  {
>  	GtkTreeView *view = GTK_TREE_VIEW(widget);
>  	GtkTreePath *path;
> @@ -690,8 +675,8 @@ on_treeview2_key_press_event(GtkWidget * widget,
>  
>  
>  /* Row selection changed: update help */
> -void
> -on_treeview2_cursor_changed(GtkTreeView * treeview, gpointer user_data)
> +static void on_treeview2_cursor_changed(GtkTreeView *treeview,
> +					gpointer user_data)
>  {
>  	GtkTreeSelection *selection;
>  	GtkTreeIter iter;
> @@ -706,9 +691,9 @@ on_treeview2_cursor_changed(GtkTreeView * treeview, gpointer user_data)
>  
>  
>  /* User click: display sub-tree in the right frame. */
> -gboolean
> -on_treeview1_button_press_event(GtkWidget * widget,
> -				GdkEventButton * event, gpointer user_data)
> +static gboolean on_treeview1_button_press_event(GtkWidget *widget,
> +						GdkEventButton *event,
> +						gpointer user_data)
>  {
>  	GtkTreeView *view = GTK_TREE_VIEW(widget);
>  	GtkTreePath *path;
> @@ -1138,47 +1123,129 @@ static void init_main_window(const gchar *glade_file)
>  	glade_xml_signal_autoconnect(xml);
>  
>  	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, "delete_event",
> +			 G_CALLBACK(on_window1_delete_event), NULL);
> +
>  	hpaned = glade_xml_get_widget(xml, "hpaned1");
>  	vpaned = glade_xml_get_widget(xml, "vpaned1");
>  	tree1_w = glade_xml_get_widget(xml, "treeview1");
> +	g_signal_connect(tree1_w, "cursor_changed",
> +			 G_CALLBACK(on_treeview2_cursor_changed), NULL);
> +	g_signal_connect(tree1_w, "button_press_event",
> +			 G_CALLBACK(on_treeview1_button_press_event), NULL);
> +	g_signal_connect(tree1_w, "key_press_event",
> +			 G_CALLBACK(on_treeview2_key_press_event), NULL);
> +
>  	tree2_w = glade_xml_get_widget(xml, "treeview2");
> +	g_signal_connect(tree2_w, "cursor_changed",
> +			 G_CALLBACK(on_treeview2_cursor_changed), NULL);
> +	g_signal_connect(tree2_w, "button_press_event",
> +			 G_CALLBACK(on_treeview2_button_press_event), NULL);
> +	g_signal_connect(tree2_w, "key_press_event",
> +			 G_CALLBACK(on_treeview2_key_press_event), NULL);
> +
>  	text_w = glade_xml_get_widget(xml, "textview3");
>  
>  	/* menubar */
> +	widget = glade_xml_get_widget(xml, "load1");
> +	g_signal_connect(widget, "activate", G_CALLBACK(on_load1_activate), NULL);
> +
> +	widget = glade_xml_get_widget(xml, "save1");
> +	g_signal_connect(widget, "activate", G_CALLBACK(on_save_activate), NULL);
> +
> +	widget = glade_xml_get_widget(xml, "save_as1");
> +	g_signal_connect(widget, "activate", G_CALLBACK(on_save_as1_activate), NULL);
> +
> +	widget = glade_xml_get_widget(xml, "quit1");
> +	g_signal_connect(widget, "activate", G_CALLBACK(on_quit1_activate), NULL);
> +
>  	widget = glade_xml_get_widget(xml, "show_name1");
> +	g_signal_connect(widget, "activate", G_CALLBACK(on_show_name1_activate), NULL);
>  	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
>  				       show_name);
>  
>  	widget = glade_xml_get_widget(xml, "show_range1");
> +	g_signal_connect(widget, "activate", G_CALLBACK(on_show_range1_activate), NULL);
>  	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
>  				       show_range);
>  
>  	widget = glade_xml_get_widget(xml, "show_data1");
> +	g_signal_connect(widget, "activate", G_CALLBACK(on_show_data1_activate), NULL);
>  	gtk_check_menu_item_set_active((GtkCheckMenuItem *) widget,
>  				       show_value);
>  
> +	widget = glade_xml_get_widget(xml, "set_option_mode1");
> +	g_signal_connect(widget, "activate",
> +			 G_CALLBACK(on_set_option_mode1_activate), NULL);
> +
> +	widget = glade_xml_get_widget(xml, "set_option_mode2");
> +	g_signal_connect(widget, "activate",
> +			 G_CALLBACK(on_set_option_mode2_activate), NULL);
> +
> +	widget = glade_xml_get_widget(xml, "set_option_mode3");
> +	g_signal_connect(widget, "activate",
> +			 G_CALLBACK(on_set_option_mode3_activate), NULL);
> +
> +	widget = glade_xml_get_widget(xml, "introduction1");
> +	g_signal_connect(widget, "activate",
> +			 G_CALLBACK(on_introduction1_activate), NULL);
> +
> +	widget = glade_xml_get_widget(xml, "about1");
> +	g_signal_connect(widget, "activate",
> +			 G_CALLBACK(on_about1_activate), NULL);
> +
> +	widget = glade_xml_get_widget(xml, "license1");
> +	g_signal_connect(widget, "activate",
> +			 G_CALLBACK(on_license1_activate), NULL);
> +
>  	/* toolbar */
>  	back_btn = glade_xml_get_widget(xml, "button1");
> +	g_signal_connect(back_btn, "clicked",
> +			 G_CALLBACK(on_back_clicked), NULL);
>  	gtk_widget_set_sensitive(back_btn, FALSE);
>  
> +	widget = glade_xml_get_widget(xml, "button2");
> +	g_signal_connect(widget, "clicked",
> +			 G_CALLBACK(on_load_clicked), NULL);
> +
>  	save_btn = glade_xml_get_widget(xml, "button3");
> +	g_signal_connect(save_btn, "clicked",
> +			 G_CALLBACK(on_save_activate), NULL);
>  	save_menu_item = glade_xml_get_widget(xml, "save1");
>  	conf_set_changed_callback(conf_changed);
>  
>  	style = gtk_widget_get_style(main_wnd);
>  
>  	single_btn = glade_xml_get_widget(xml, "button4");
> +	g_signal_connect(single_btn, "clicked",
> +			 G_CALLBACK(on_single_clicked), NULL);
>  	replace_button_icon(xml, main_wnd->window, style,
>  			    "button4", (gchar **) xpm_single_view);
>  
>  	split_btn = glade_xml_get_widget(xml, "button5");
> +	g_signal_connect(split_btn, "clicked",
> +			 G_CALLBACK(on_split_clicked), NULL);
>  	replace_button_icon(xml, main_wnd->window, style,
>  			    "button5", (gchar **) xpm_split_view);
>  
>  	full_btn = glade_xml_get_widget(xml, "button6");
> +	g_signal_connect(full_btn, "clicked",
> +			 G_CALLBACK(on_full_clicked), NULL);
>  	replace_button_icon(xml, main_wnd->window, style,
>  			    "button6", (gchar **) xpm_tree_view);
>  
> +	widget = glade_xml_get_widget(xml, "button7");
> +	g_signal_connect(widget, "clicked",
> +			 G_CALLBACK(on_collapse_clicked), NULL);
> +
> +	widget = glade_xml_get_widget(xml, "button8");
> +	g_signal_connect(widget, "clicked",
> +			 G_CALLBACK(on_expand_clicked), NULL);
> +
>  	txtbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w));
>  	tag1 = gtk_text_buffer_create_tag(txtbuf, "mytag1",
>  					  "foreground", "red",
> diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.glade
> index 19b80f2ec1ff..8519104a3c2b 100644
> --- a/scripts/kconfig/gconf.glade
> +++ b/scripts/kconfig/gconf.glade
> @@ -17,9 +17,6 @@
>    <property name="skip_pager_hint">False</property>
>    <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
>    <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
> -  <signal name="destroy" handler="on_window1_destroy" object="window1"/>
> -  <signal name="size_request" handler="on_window1_size_request" object="vpaned1" last_modification_time="Fri, 11 Jan 2002 16:17:11 GMT"/>
> -  <signal name="delete_event" handler="on_window1_delete_event" object="window1" last_modification_time="Sun, 09 Mar 2003 19:42:46 GMT"/>
>  
>    <child>
>      <widget class="GtkVBox" id="vbox1">
> @@ -46,7 +43,6 @@
>  		      <property name="tooltip" translatable="yes">Load a config file</property>
>  		      <property name="label" translatable="yes">_Load</property>
>  		      <property name="use_underline">True</property>
> -		      <signal name="activate" handler="on_load1_activate"/>
>  		      <accelerator key="L" modifiers="GDK_CONTROL_MASK" signal="activate"/>
>  		    </widget>
>  		  </child>
> @@ -57,7 +53,6 @@
>  		      <property name="tooltip" translatable="yes">Save the config in .config</property>
>  		      <property name="label" translatable="yes">_Save</property>
>  		      <property name="use_underline">True</property>
> -		      <signal name="activate" handler="on_save_activate"/>
>  		      <accelerator key="S" modifiers="GDK_CONTROL_MASK" signal="activate"/>
>  		    </widget>
>  		  </child>
> @@ -68,7 +63,6 @@
>  		      <property name="tooltip" translatable="yes">Save the config in a file</property>
>  		      <property name="label" translatable="yes">Save _as</property>
>  		      <property name="use_underline">True</property>
> -		      <signal name="activate" handler="on_save_as1_activate"/>
>  		    </widget>
>  		  </child>
>  
> @@ -83,7 +77,6 @@
>  		      <property name="visible">True</property>
>  		      <property name="label" translatable="yes">_Quit</property>
>  		      <property name="use_underline">True</property>
> -		      <signal name="activate" handler="on_quit1_activate"/>
>  		      <accelerator key="Q" modifiers="GDK_CONTROL_MASK" signal="activate"/>
>  		    </widget>
>  		  </child>
> @@ -108,7 +101,6 @@
>  		      <property name="label" translatable="yes">Show _name</property>
>  		      <property name="use_underline">True</property>
>  		      <property name="active">False</property>
> -		      <signal name="activate" handler="on_show_name1_activate"/>
>  		    </widget>
>  		  </child>
>  
> @@ -119,7 +111,6 @@
>  		      <property name="label" translatable="yes">Show _range</property>
>  		      <property name="use_underline">True</property>
>  		      <property name="active">False</property>
> -		      <signal name="activate" handler="on_show_range1_activate"/>
>  		    </widget>
>  		  </child>
>  
> @@ -130,7 +121,6 @@
>  		      <property name="label" translatable="yes">Show _data</property>
>  		      <property name="use_underline">True</property>
>  		      <property name="active">False</property>
> -		      <signal name="activate" handler="on_show_data1_activate"/>
>  		    </widget>
>  		  </child>
>  
> @@ -147,7 +137,6 @@
>  		      <property name="label" translatable="yes">Show normal options</property>
>  		      <property name="use_underline">True</property>
>  		      <property name="active">True</property>
> -		      <signal name="activate" handler="on_set_option_mode1_activate"/>
>  		    </widget>
>  		  </child>
>  
> @@ -159,7 +148,6 @@
>  		      <property name="use_underline">True</property>
>  		      <property name="active">False</property>
>  		      <property name="group">set_option_mode1</property>
> -		      <signal name="activate" handler="on_set_option_mode2_activate"/>
>  		    </widget>
>  		  </child>
>  
> @@ -171,7 +159,6 @@
>  		      <property name="use_underline">True</property>
>  		      <property name="active">False</property>
>  		      <property name="group">set_option_mode1</property>
> -		      <signal name="activate" handler="on_set_option_mode3_activate"/>
>  		    </widget>
>  		  </child>
>  
> @@ -194,7 +181,6 @@
>  		      <property name="visible">True</property>
>  		      <property name="label" translatable="yes">_Introduction</property>
>  		      <property name="use_underline">True</property>
> -		      <signal name="activate" handler="on_introduction1_activate" last_modification_time="Fri, 15 Nov 2002 20:26:30 GMT"/>
>  		      <accelerator key="I" modifiers="GDK_CONTROL_MASK" signal="activate"/>
>  		    </widget>
>  		  </child>
> @@ -204,7 +190,6 @@
>  		      <property name="visible">True</property>
>  		      <property name="label" translatable="yes">_About</property>
>  		      <property name="use_underline">True</property>
> -		      <signal name="activate" handler="on_about1_activate" last_modification_time="Fri, 15 Nov 2002 20:26:30 GMT"/>
>  		      <accelerator key="A" modifiers="GDK_CONTROL_MASK" signal="activate"/>
>  		    </widget>
>  		  </child>
> @@ -214,7 +199,6 @@
>  		      <property name="visible">True</property>
>  		      <property name="label" translatable="yes">_License</property>
>  		      <property name="use_underline">True</property>
> -		      <signal name="activate" handler="on_license1_activate" last_modification_time="Fri, 15 Nov 2002 20:26:30 GMT"/>
>  		    </widget>
>  		  </child>
>  		</widget>
> @@ -254,7 +238,6 @@
>  		  <property name="visible_horizontal">True</property>
>  		  <property name="visible_vertical">True</property>
>  		  <property name="is_important">False</property>
> -		  <signal name="clicked" handler="on_back_clicked"/>
>  		</widget>
>  		<packing>
>  		  <property name="expand">False</property>
> @@ -291,7 +274,6 @@
>  		  <property name="visible_horizontal">True</property>
>  		  <property name="visible_vertical">True</property>
>  		  <property name="is_important">False</property>
> -		  <signal name="clicked" handler="on_load_clicked"/>
>  		</widget>
>  		<packing>
>  		  <property name="expand">False</property>
> @@ -309,7 +291,6 @@
>  		  <property name="visible_horizontal">True</property>
>  		  <property name="visible_vertical">True</property>
>  		  <property name="is_important">False</property>
> -		  <signal name="clicked" handler="on_save_activate"/>
>  		</widget>
>  		<packing>
>  		  <property name="expand">False</property>
> @@ -346,7 +327,6 @@
>  		  <property name="visible_horizontal">True</property>
>  		  <property name="visible_vertical">True</property>
>  		  <property name="is_important">False</property>
> -		  <signal name="clicked" handler="on_single_clicked" last_modification_time="Sun, 12 Jan 2003 14:28:39 GMT"/>
>  		</widget>
>  		<packing>
>  		  <property name="expand">False</property>
> @@ -364,7 +344,6 @@
>  		  <property name="visible_horizontal">True</property>
>  		  <property name="visible_vertical">True</property>
>  		  <property name="is_important">False</property>
> -		  <signal name="clicked" handler="on_split_clicked" last_modification_time="Sun, 12 Jan 2003 14:28:45 GMT"/>
>  		</widget>
>  		<packing>
>  		  <property name="expand">False</property>
> @@ -382,7 +361,6 @@
>  		  <property name="visible_horizontal">True</property>
>  		  <property name="visible_vertical">True</property>
>  		  <property name="is_important">False</property>
> -		  <signal name="clicked" handler="on_full_clicked" last_modification_time="Sun, 12 Jan 2003 14:28:50 GMT"/>
>  		</widget>
>  		<packing>
>  		  <property name="expand">False</property>
> @@ -419,7 +397,6 @@
>  		  <property name="visible_horizontal">True</property>
>  		  <property name="visible_vertical">True</property>
>  		  <property name="is_important">False</property>
> -		  <signal name="clicked" handler="on_collapse_clicked"/>
>  		</widget>
>  		<packing>
>  		  <property name="expand">False</property>
> @@ -437,7 +414,6 @@
>  		  <property name="visible_horizontal">True</property>
>  		  <property name="visible_vertical">True</property>
>  		  <property name="is_important">False</property>
> -		  <signal name="clicked" handler="on_expand_clicked"/>
>  		</widget>
>  		<packing>
>  		  <property name="expand">False</property>
> @@ -477,9 +453,6 @@
>  		  <property name="rules_hint">False</property>
>  		  <property name="reorderable">False</property>
>  		  <property name="enable_search">False</property>
> -		  <signal name="cursor_changed" handler="on_treeview2_cursor_changed" last_modification_time="Sun, 12 Jan 2003 15:58:22 GMT"/>
> -		  <signal name="button_press_event" handler="on_treeview1_button_press_event" last_modification_time="Sun, 12 Jan 2003 16:03:52 GMT"/>
> -		  <signal name="key_press_event" handler="on_treeview2_key_press_event" last_modification_time="Sun, 12 Jan 2003 16:11:44 GMT"/>
>  		</widget>
>  	      </child>
>  	    </widget>
> @@ -512,9 +485,6 @@
>  		      <property name="rules_hint">False</property>
>  		      <property name="reorderable">False</property>
>  		      <property name="enable_search">False</property>
> -		      <signal name="cursor_changed" handler="on_treeview2_cursor_changed" last_modification_time="Sun, 12 Jan 2003 15:57:55 GMT"/>
> -		      <signal name="button_press_event" handler="on_treeview2_button_press_event" last_modification_time="Sun, 12 Jan 2003 15:57:58 GMT"/>
> -		      <signal name="key_press_event" handler="on_treeview2_key_press_event" last_modification_time="Sun, 12 Jan 2003 15:58:01 GMT"/>
>  		    </widget>
>  		  </child>
>  		</widget>

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 30/66] kconfig: gconf: remove glade_xml_signal_autoconnect() call
  2025-06-24 15:05 ` [PATCH 30/66] kconfig: gconf: remove glade_xml_signal_autoconnect() call Masahiro Yamada
@ 2025-06-30  2:58   ` Randy Dunlap
  2025-06-30  4:14     ` Masahiro Yamada
  0 siblings, 1 reply; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  2:58 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> Now that all signals are connected manually, this is no longer
> unnecessary.

Double negative. Or is that what you meant?

is no longer necessary.
is now unnecessary.

> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  scripts/kconfig/gconf.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index 02bbb7ce4c4a..09537245213a 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -1120,7 +1120,6 @@ static void init_main_window(const gchar *glade_file)
>  	xml = glade_xml_new(glade_file, "window1", NULL);
>  	if (!xml)
>  		g_error("GUI loading failed !\n");
> -	glade_xml_signal_autoconnect(xml);
>  
>  	main_wnd = glade_xml_get_widget(xml, "window1");
>  	g_signal_connect(main_wnd, "destroy",

-- 
~Randy


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 36/66] kconfig: gconf: use GtkFileChooser in on_load1_activate()
  2025-06-24 15:05 ` [PATCH 36/66] kconfig: gconf: use GtkFileChooser in on_load1_activate() Masahiro Yamada
@ 2025-06-30  3:14   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  3:14 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> gtk_file_selection_new() is deprecated, and gtk_file_chooser_dialog_new()
> should be used instead. [1]
> 
> [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/docs/reference/gtk/tmpl/gtkfilesel.sgml?ref_type=tags#L156
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Old gconfig (pre-patches) did not even clear the error message on a good Load.
I still see (on OLD)
  Unable to load configuration !
after a successful Load (determined by Save and diff).
This is no longer a problem.


Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>


> ---
> 
>  scripts/kconfig/gconf.c | 58 ++++++++++++++++++++---------------------
>  1 file changed, 29 insertions(+), 29 deletions(-)
> 
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index 8c60b9f25eaa..f33f39d50f3d 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -157,38 +157,38 @@ static void text_insert_msg(const char *title, const char *message)
>  
>  /* Menu & Toolbar Callbacks */
>  
> -
> -static void
> -load_filename(GtkFileSelection * file_selector, gpointer user_data)
> -{
> -	const gchar *fn;
> -
> -	fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION
> -					     (user_data));
> -
> -	if (conf_read(fn))
> -		text_insert_msg("Error", "Unable to load configuration !");
> -	else
> -		display_tree_part();
> -}
> -
>  static void on_load1_activate(GtkMenuItem *menuitem, gpointer user_data)
>  {
> -	GtkWidget *fs;
> +	GtkWidget *dialog;
> +	GtkFileChooser *chooser;
> +	gint res;
>  
> -	fs = gtk_file_selection_new("Load file...");
> -	g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
> -			 "clicked",
> -			 G_CALLBACK(load_filename), (gpointer) fs);
> -	g_signal_connect_swapped(GTK_OBJECT
> -				 (GTK_FILE_SELECTION(fs)->ok_button),
> -				 "clicked", G_CALLBACK(gtk_widget_destroy),
> -				 (gpointer) fs);
> -	g_signal_connect_swapped(GTK_OBJECT
> -				 (GTK_FILE_SELECTION(fs)->cancel_button),
> -				 "clicked", G_CALLBACK(gtk_widget_destroy),
> -				 (gpointer) fs);
> -	gtk_widget_show(fs);
> +	dialog = gtk_file_chooser_dialog_new("Load file...",
> +					     GTK_WINDOW(user_data),
> +					     GTK_FILE_CHOOSER_ACTION_OPEN,
> +					     "_Cancel", GTK_RESPONSE_CANCEL,
> +					     "_Open", GTK_RESPONSE_ACCEPT,
> +					     NULL);
> +
> +	chooser = GTK_FILE_CHOOSER(dialog);
> +	gtk_file_chooser_set_filename(chooser, conf_get_configname());
> +
> +	res = gtk_dialog_run(GTK_DIALOG(dialog));
> +	if (res == GTK_RESPONSE_ACCEPT) {
> +		char *filename;
> +
> +		filename = gtk_file_chooser_get_filename(chooser);
> +
> +		if (conf_read(filename))
> +			text_insert_msg("Error",
> +					"Unable to load configuration!");
> +		else
> +			display_tree_part();
> +
> +		g_free(filename);
> +	}
> +
> +	gtk_widget_destroy(GTK_WIDGET(dialog));
>  }
>  
>  static void on_save_activate(GtkMenuItem *menuitem, gpointer user_data)

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 37/66] kconfig: gconf: use GtkFileChooser in on_save_as1_activate()
  2025-06-24 15:05 ` [PATCH 37/66] kconfig: gconf: use GtkFileChooser in on_save_as1_activate() Masahiro Yamada
@ 2025-06-30  3:20   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  3:20 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> gtk_file_selection_new() is deprecated, and gtk_file_chooser_dialog_new()
> should be used instead. [1]
> 
> [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/docs/reference/gtk/tmpl/gtkfilesel.sgml?ref_type=tags#L156
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>



> ---
> 
>  scripts/kconfig/gconf.c | 56 ++++++++++++++++++++---------------------
>  1 file changed, 27 insertions(+), 29 deletions(-)
> 
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index f33f39d50f3d..b019711142c3 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -198,38 +198,36 @@ static void on_save_activate(GtkMenuItem *menuitem, gpointer user_data)
>  	conf_write_autoconf(0);
>  }
>  
> -
> -static void
> -store_filename(GtkFileSelection * file_selector, gpointer user_data)
> -{
> -	const gchar *fn;
> -
> -	fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION
> -					     (user_data));
> -
> -	if (conf_write(fn))
> -		text_insert_msg("Error", "Unable to save configuration !");
> -
> -	gtk_widget_destroy(GTK_WIDGET(user_data));
> -}
> -
>  static void on_save_as1_activate(GtkMenuItem *menuitem, gpointer user_data)
>  {
> -	GtkWidget *fs;
> +	GtkWidget *dialog;
> +	GtkFileChooser *chooser;
> +	gint res;
>  
> -	fs = gtk_file_selection_new("Save file as...");
> -	g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
> -			 "clicked",
> -			 G_CALLBACK(store_filename), (gpointer) fs);
> -	g_signal_connect_swapped(GTK_OBJECT
> -				 (GTK_FILE_SELECTION(fs)->ok_button),
> -				 "clicked", G_CALLBACK(gtk_widget_destroy),
> -				 (gpointer) fs);
> -	g_signal_connect_swapped(GTK_OBJECT
> -				 (GTK_FILE_SELECTION(fs)->cancel_button),
> -				 "clicked", G_CALLBACK(gtk_widget_destroy),
> -				 (gpointer) fs);
> -	gtk_widget_show(fs);
> +	dialog = gtk_file_chooser_dialog_new("Save file as...",
> +					     GTK_WINDOW(user_data),
> +					     GTK_FILE_CHOOSER_ACTION_SAVE,
> +					     "_Cancel", GTK_RESPONSE_CANCEL,
> +					     "_Save", GTK_RESPONSE_ACCEPT,
> +					     NULL);
> +
> +	chooser = GTK_FILE_CHOOSER(dialog);
> +	gtk_file_chooser_set_filename(chooser, conf_get_configname());
> +
> +	res = gtk_dialog_run(GTK_DIALOG(dialog));
> +	if (res == GTK_RESPONSE_ACCEPT) {
> +		char *filename;
> +
> +		filename = gtk_file_chooser_get_filename(chooser);
> +
> +		if (conf_write(filename))
> +			text_insert_msg("Error",
> +					"Unable to save configuration !");
> +
> +		g_free(filename);
> +	}
> +
> +	gtk_widget_destroy(dialog);
>  }
>  
>  static void on_show_name1_activate(GtkMenuItem *menuitem, gpointer user_data)

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 02/66] kconfig: qconf: do not show checkbox icon for choice
  2025-06-29 20:15   ` Randy Dunlap
@ 2025-06-30  3:36     ` Masahiro Yamada
  0 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-30  3:36 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kbuild, linux-kernel

On Mon, Jun 30, 2025 at 5:15 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
>
>
> On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> > When you select "Show All Options" or "Show Prompt Options", choice
> > entries display a check box icon, but this has no point because
> > choice is always y since commit
>
>                      since commit _____________________.


since commit fde192511bdb ("kconfig: remove tristate choice support").


I will fix it.
Thanks.



> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >
> >  scripts/kconfig/qconf.cc | 11 ++++++-----
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> > index eaa465b0ccf9..546738a5c3b1 100644
> > --- a/scripts/kconfig/qconf.cc
> > +++ b/scripts/kconfig/qconf.cc
> > @@ -92,7 +92,6 @@ void ConfigItem::updateMenu(void)
> >  {
> >       ConfigList* list;
> >       struct symbol* sym;
> > -     struct property *prop;
> >       QString prompt;
> >       int type;
> >       tristate expr;
> > @@ -105,11 +104,10 @@ void ConfigItem::updateMenu(void)
> >       }
> >
> >       sym = menu->sym;
> > -     prop = menu->prompt;
> >       prompt = menu_get_prompt(menu);
> >
> > -     if (prop) switch (prop->type) {
> > -     case P_MENU:
> > +     switch (menu->type) {
> > +     case M_MENU:
> >               if (list->mode == singleMode) {
> >                       /* a menuconfig entry is displayed differently
> >                        * depending whether it's at the view root or a child.
> > @@ -123,10 +121,13 @@ void ConfigItem::updateMenu(void)
> >                       setIcon(promptColIdx, QIcon());
> >               }
> >               goto set_prompt;
> > -     case P_COMMENT:
> > +     case M_COMMENT:
> >               setIcon(promptColIdx, QIcon());
> >               prompt = "*** " + prompt + " ***";
> >               goto set_prompt;
> > +     case M_CHOICE:
> > +             setIcon(promptColIdx, QIcon());
> > +             goto set_prompt;
> >       default:
> >               ;
> >       }
>
> --
> ~Randy
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 40/66] kconfig: gconf: make introduction, about, license dialogs modal
  2025-06-24 15:05 ` [PATCH 40/66] kconfig: gconf: make introduction, about, license dialogs modal Masahiro Yamada
@ 2025-06-30  4:09   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  4:09 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> These are modal dialogs in xconfig. Make them modal in gconfig as well.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>


> ---
> 
>  scripts/kconfig/gconf.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
> 

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 45/66] kconfig: gconf: remove global 'model1' and 'model2' variables
  2025-06-24 15:05 ` [PATCH 45/66] kconfig: gconf: remove global 'model1' and 'model2' variables Masahiro Yamada
@ 2025-06-30  4:10   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  4:10 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> These variables are unnecessary because the current model can be
> retrieved using gtk_tree_view_get_model().
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>

> ---
> 
>  scripts/kconfig/gconf.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 30/66] kconfig: gconf: remove glade_xml_signal_autoconnect() call
  2025-06-30  2:58   ` Randy Dunlap
@ 2025-06-30  4:14     ` Masahiro Yamada
  0 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-30  4:14 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kbuild, linux-kernel

On Mon, Jun 30, 2025 at 11:58 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
>
>
> On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> > Now that all signals are connected manually, this is no longer
> > unnecessary.
>
> Double negative. Or is that what you meant?
>
> is no longer necessary.
> is now unnecessary.


is no longer necessary.

I will fix it. Thanks.






> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >
> >  scripts/kconfig/gconf.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> > index 02bbb7ce4c4a..09537245213a 100644
> > --- a/scripts/kconfig/gconf.c
> > +++ b/scripts/kconfig/gconf.c
> > @@ -1120,7 +1120,6 @@ static void init_main_window(const gchar *glade_file)
> >       xml = glade_xml_new(glade_file, "window1", NULL);
> >       if (!xml)
> >               g_error("GUI loading failed !\n");
> > -     glade_xml_signal_autoconnect(xml);
> >
> >       main_wnd = glade_xml_get_widget(xml, "window1");
> >       g_signal_connect(main_wnd, "destroy",
>
> --
> ~Randy
>
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 21/66] kconfig: gconf: remove unneeded variables in on_treeview*_button_press_event()
  2025-06-30  2:40   ` Randy Dunlap
@ 2025-06-30  4:22     ` Masahiro Yamada
  0 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-30  4:22 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kbuild, linux-kernel

On Mon, Jun 30, 2025 at 11:40 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
>
>
> On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> > No all position parameters are used here. Passing NULL to
>
>   Not all
>
> > gtk_tree_view_get_cursor() or gtk_tree_view_get_path_at_pos() is
> > allowed. [1] [2]
> >
> > [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12638
> > [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12795
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Thanks. I will locally fix it.


> >
> >  scripts/kconfig/gconf.c | 14 +++-----------
> >  1 file changed, 3 insertions(+), 11 deletions(-)
>
> --
> ~Randy



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 53/66] kconfig: gconf: use size_allocate event handler
  2025-06-29 17:56   ` Masahiro Yamada
@ 2025-06-30  5:23     ` Randy Dunlap
  2025-06-30  5:30       ` Masahiro Yamada
  0 siblings, 1 reply; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  5:23 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/29/25 10:56 AM, Masahiro Yamada wrote:
> On Wed, Jun 25, 2025 at 12:09 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>>
>> The size_request event is not available in GTK 3. Use the size_allocate
>> event handler instead.
>>
>> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>> ---
> 
> This has a regression - with this, we cannot move
> the horizontal separator between in the right pane.

Between the menu items and the message area?
That's what I see.

> 
> I will use the "configure-event" event instead.
> 
>>
>>  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
>>
> 
> 

-- 
~Randy


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 55/66] kconfig: gconf: replace GTK_STOCK_{OK,NO,CANCEL}
  2025-06-24 15:05 ` [PATCH 55/66] kconfig: gconf: replace GTK_STOCK_{OK,NO,CANCEL} Masahiro Yamada
@ 2025-06-30  5:26   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  5:26 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> These are deprecated with GTK 3.10. [1]
> 
> Use "_OK", "_no", "_Cancel".
> 

That's bad (on GTK) IMO. I would much rather see (and try to remember)
a symbolic name than some half-random string.


> [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/3.10.0/gtk/deprecated/gtkstock.h#L827
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  scripts/kconfig/gconf.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index 28953449a1ed..32d1815b425e 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -686,11 +686,11 @@ static gboolean on_window1_delete_event(GtkWidget *widget, GdkEvent *event,
>  					     (GtkDialogFlags)
>  					     (GTK_DIALOG_MODAL |
>  					      GTK_DIALOG_DESTROY_WITH_PARENT),
> -					     GTK_STOCK_OK,
> +					     "_OK",
>  					     GTK_RESPONSE_YES,
> -					     GTK_STOCK_NO,
> +					     "_No",
>  					     GTK_RESPONSE_NO,
> -					     GTK_STOCK_CANCEL,
> +					     "_Cancel",
>  					     GTK_RESPONSE_CANCEL, NULL);
>  	gtk_dialog_set_default_response(GTK_DIALOG(dialog),
>  					GTK_RESPONSE_CANCEL);

-- 
~Randy


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 53/66] kconfig: gconf: use size_allocate event handler
  2025-06-30  5:23     ` Randy Dunlap
@ 2025-06-30  5:30       ` Masahiro Yamada
  0 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-30  5:30 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kbuild, linux-kernel

On Mon, Jun 30, 2025 at 2:23 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
>
>
> On 6/29/25 10:56 AM, Masahiro Yamada wrote:
> > On Wed, Jun 25, 2025 at 12:09 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >>
> >> The size_request event is not available in GTK 3. Use the size_allocate
> >> event handler instead.
> >>
> >> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> >> ---
> >
> > This has a regression - with this, we cannot move
> > the horizontal separator between in the right pane.
>
> Between the menu items and the message area?
> That's what I see.

Right.

The horizontal bar between the menu tree and the
help message area.

Before this patch series, you can drag it up and down
using a mouse.

With v1 applied, you cannot move it.

This problem was fixed in v2.





-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 57/66] kconfig: gconf: replace "tooltip" property with "tooltip-text"
  2025-06-24 15:05 ` [PATCH 57/66] kconfig: gconf: replace "tooltip" property with "tooltip-text" Masahiro Yamada
@ 2025-06-30  5:36   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  5:36 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> This was replaced with "tooltip-text" in GtkBuilder with GTK 3.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>

One nit below:

> ---
> 
>  scripts/kconfig/gconf.glade | 34 +++++++++++++++++-----------------
>  1 file changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.glade
> index c0ada331a5bf..c3996f4635e9 100644
> --- a/scripts/kconfig/gconf.glade
> +++ b/scripts/kconfig/gconf.glade
> @@ -230,7 +230,7 @@
>  	      <child>
>  		<widget class="GtkToolButton" id="button1">
>  		  <property name="visible">True</property>
> -		  <property name="tooltip" translatable="yes">Goes up of one level (single view)</property>
> +		  <property name="tooltip-text" translatable="yes">Goes up of one level (single view)</property>

You didn't change the text here, but this would read better as

  Goes up by one level
or
  Goes up one level

I.e., drop the "of".

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 43/66] kconfig: gconf: preserve menu selection when switching view mode
  2025-06-24 15:05 ` [PATCH 43/66] kconfig: gconf: preserve menu selection when switching view mode Masahiro Yamada
@ 2025-06-30  5:42   ` Masahiro Yamada
  0 siblings, 0 replies; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-30  5:42 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel

On Wed, Jun 25, 2025 at 12:08 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Preserve the current menu selection when switching to a different view
> mode, as it improves usability.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---

There is a corner case where this does not work in Split view.
One example is a top-level symbol, such as CONFIG_64BIT.

For x86, CONFIG_64BIT is located at the top-level,
and it does not belong to any menu.

This works in Single and Full views.

[1] Choose Full view  (default)
[2] Select "64-bit kernel"
[3] Choose Single view and Full view back-and-forth
[4] "64-bit kernel" is still selected


However, this does not work in Split View:
[1] Choose Full view  (default)
[2] Select "64-bit kernel"
[3] Choose Split view
[4] "64-bit kernel" is not selected


The Split view never works in a consistent way.
I will consider whether I should fix such a corner case or not.





-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 66/66] kconfig: gconf: show GTK version in About dialog
  2025-06-24 15:05 ` [PATCH 66/66] kconfig: gconf: show GTK version in About dialog Masahiro Yamada
@ 2025-06-30  6:06   ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  6:06 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:05 AM, Masahiro Yamada wrote:
> Likewise xconfig, it is useful to display the GTK version in the About
> dialog.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>

> ---
> 
>  scripts/kconfig/gconf.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
> index 5b1b468e782d..7340407e4d6e 100644
> --- a/scripts/kconfig/gconf.c
> +++ b/scripts/kconfig/gconf.c
> @@ -579,7 +579,11 @@ static void on_about1_activate(GtkMenuItem *menuitem, gpointer user_data)
>  	dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
>  					GTK_DIALOG_DESTROY_WITH_PARENT,
>  					GTK_MESSAGE_INFO,
> -					GTK_BUTTONS_CLOSE, "%s", about_text);
> +					GTK_BUTTONS_CLOSE, "%s\nGTK version: %d.%d.%d",
> +					about_text,
> +					gtk_get_major_version(),
> +					gtk_get_minor_version(),
> +					gtk_get_micro_version());
>  	gtk_dialog_run(GTK_DIALOG(dialog));
>  	gtk_widget_destroy(dialog);
>  }

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed
  2025-06-24 15:04 ` [PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed Masahiro Yamada
@ 2025-06-30  6:34   ` Randy Dunlap
  2025-07-02 13:23     ` Masahiro Yamada
  0 siblings, 1 reply; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  6:34 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> In gconf, choice entries display the selected symbol in the 'Value'
> column, but it is not updated when the selected symbol is changed.
> 
> Set the MENU_CHANGED flag, so it is updated.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Probably not related to this change (AFAICT), but I was trying to
reproduce this problem and I cannot do it.

To enable an option (any options, choice or not), I have to double-click
on it or (sometimes, not for choice) I can use Y / N / M on the keyboard.
When I do either of those, the value (including a choice value) is changed.

I mention double-click only because the Help text (Information) says that
clicking will cycle thru Y/M/N.

The Information also says that "dot indicates that it is to be compiled as a module".
I see more of a Dash or Hyphen or just a horizontal bar.

Thanks for reading...

> ---
> 
>  scripts/kconfig/symbol.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
> index d57f8cbba291..26ab10c0fd76 100644
> --- a/scripts/kconfig/symbol.c
> +++ b/scripts/kconfig/symbol.c
> @@ -195,6 +195,10 @@ static void sym_set_changed(struct symbol *sym)
>  
>  	list_for_each_entry(menu, &sym->menus, link)
>  		menu->flags |= MENU_CHANGED;
> +
> +	menu = sym_get_choice_menu(sym);
> +	if (menu)
> +		menu->flags |= MENU_CHANGED;
>  }
>  
>  static void sym_set_all_changed(void)

-- 
~Randy


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 00/66] kconfig: improve xconfig and gconfig
  2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
                   ` (65 preceding siblings ...)
  2025-06-24 15:05 ` [PATCH 66/66] kconfig: gconf: show GTK version in About dialog Masahiro Yamada
@ 2025-06-30  6:55 ` Randy Dunlap
  2025-06-30 15:48   ` Masahiro Yamada
  66 siblings, 1 reply; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30  6:55 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel



On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> [xconfig]
> 
>  - small improvement for choice
> 
> [gconfig]
> 
>  - Fix memory leak
>  - Lots of refactoring
>  - Migrate GTK 2 to GTK 3
>  - Fix all compile warnings
>  - Improve usability (grey out buttons, keep the item selection, etc.)
> 
> 

Hi,
I have tested all 65 patches here (omitting 52).
They worked well. Good job.
I will test your git tree/branch Monday/Tuesday.

I did notice one visual difference. The GTK+2 version of
gconfig (before the patches) uses an alternating white/light gray
background for the menu items while the GTK+3 version (after the
patches) uses an all white background.

I prefer the alternating but it may be just some collateral damage
in the name of progress.  Or could be something else entirely!

Before you posted all of these gconfig patches, I was going to ask
how many gconfig users are there?  I don't see much on the mailing
list about gconfig from users and suggest that maybe we should just
drop it, but if you are OK with maintaining it and updating it like
in this patch series, so be it.

I did seem to have found one gconfig user [1]. Maybe you are also
a gconfig user.


[1] https://lore.kernel.org/linux-kbuild/67b44d49-d23c-fab0-e165-cc84817562af@infradead.org/



> 
> Masahiro Yamada (66):
>   kconfig: set MENU_CHANGED to choice when the selected member is
>     changed
>   kconfig: qconf: do not show checkbox icon for choice
>   kconfig: qconf: show selected choice in the Value column
>   kconfig: rename menu_get_parent_menu() to
>     menu_get_menu_or_parent_menu()
>   kconfig: re-add menu_get_parent_menu() that returns parent menu
>   kconfig: gconf: make columns resizable
>   kconfig: gconf: fix potential memory leak in renderer_edited()
>   kconfig: gconf: always destroy dialog in on_window1_delete_event()
>   kconfig: gconf: remove old #ifdef GTK_CHECK_VERSION
>   kconfig: gconf: remove empty if-block
>   kconfig: gconf: remove meaningless code in init_main_window()
>   kconfig: gconf: remove unneeded gtk_tree_view_set_headers_visible()
>     calls
>   kconfig: gconf: remove gtk_tree_view_column_set_visible() calls
>   kconfig: gconf: remove gtk_widget_realize() calls
>   kconfig: gconf: remove gtk_tree_view_set_rules_hint() calls
>   kconfig: gconf: remove unnecessary gtk_set_locale() call
>   kconfig: gconf: remove internal-child="image" nodes from glade
>   kconfig: gconf: remove parents[] array and indent variable
>   kconfig: gconf: remove unnecessary NULL checks for tree1 and tree2
>   kconfig: gconf: remove unneeded variable in on_split_clicked()
>   kconfig: gconf: remove unneeded variables in
>     on_treeview*_button_press_event()
>   kconfig: gconf: remove unused 'color' variable
>   kconfig: gconf: add static qualifiers to variables
>   kconfig: gconf: move init_*() functions below
>   kconfig: gconf: refactor view setting code
>   kconfig: gconf: grey out button for current view
>   kconfig: gconf: move the main window event handlers below
>   kconfig: gconf: move button1 initialization below
>   kconfig: gconf: add static qualifiers to event handlers
>   kconfig: gconf: remove glade_xml_signal_autoconnect() call
>   kconfig: gconf: make key_press_event work in left pane too
>   kconfig: gconf: avoid hardcoding model2 in
>     on_treeview2_cursor_changed()
>   kconfig: gconf: avoid hardcoding model2 in renderer_edited()
>   kconfig: gconf: avoid hardcoding model* in
>     on_treeview*_button_press_event()
>   kconfig: gconf: add on_save_clicked() event handler
>   kconfig: gconf: use GtkFileChooser in on_load1_activate()
>   kconfig: gconf: use GtkFileChooser in on_save_as1_activate()
>   kconfig: gconf: use GdkPixbuf in replace_button_icon()
>   kconfig: gconf: refactor replace_button_icon()
>   kconfig: gconf: make introduction, about, license dialogs modal
>   kconfig: gconf: remove global 'tree' variable
>   kconfig: gconf: merge 'current' and 'browsed' global variables
>   kconfig: gconf: preserve menu selection when switching view mode
>   kconfig: gconf: use GtkTreeModelFilter to control row visibility
>   kconfig: gconf: remove global 'model1' and 'model2' variables
>   kconfig: gconf: remove init_tree_model()
>   kconfig: gconf: inline fill_row() into set_node()
>   kconfig: gconf: do not reconstruct tree store when a symbol is changed
>   kconfig: gconf: inline display_list() into set_view_mode()
>   kconfig: gconf: remove dead code in display_tree_part()
>   kconfig: gconf: rename display_tree_part()
>   kconfig: gconf: remove fixup_rootmenu()
>   kconfig: gconf: use size_allocate event handler
>   kconfig: gconf: replace GDK_space with GDK_KEY_space
>   kconfig: gconf: replace GTK_STOCK_{OK,NO,CANCEL}
>   kconfig: gconf: remove "tooltips" property from glade
>   kconfig: gconf: replace "tooltip" property with "tooltip-text"
>   kconfig: gconf: remove unnecessary default message in text view
>   kconfig: gconf: use gtk_check_menu_item_get_active() accessor
>   kconfig: gconf: use gtk_dialog_get_content_area() accessor
>   kconfig: gconf: remove GtkHandleBox from glade
>   kconfig: gconf: rename gconf.glade to gconf.ui
>   kconfig: gconf: migrate to GTK 3
>   kconfig: gconf: replace GtkVbox with GtkBox
>   kconfig: gconf: replace GdkColor with GdkRGBA
>   kconfig: gconf: show GTK version in About dialog
> 
>  scripts/kconfig/conf.c                    |    2 +-
>  scripts/kconfig/gconf-cfg.sh              |   11 +-
>  scripts/kconfig/gconf.c                   | 1828 ++++++++++-----------
>  scripts/kconfig/{gconf.glade => gconf.ui} |  360 ++--
>  scripts/kconfig/lkc.h                     |    1 +
>  scripts/kconfig/menu.c                    |   20 +
>  scripts/kconfig/qconf.cc                  |   26 +-
>  scripts/kconfig/symbol.c                  |    4 +
>  8 files changed, 1023 insertions(+), 1229 deletions(-)
>  rename scripts/kconfig/{gconf.glade => gconf.ui} (57%)
> 

-- 
~Randy


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 00/66] kconfig: improve xconfig and gconfig
  2025-06-30  6:55 ` [PATCH 00/66] kconfig: improve xconfig and gconfig Randy Dunlap
@ 2025-06-30 15:48   ` Masahiro Yamada
  2025-06-30 23:43     ` Randy Dunlap
  0 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-06-30 15:48 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kbuild, linux-kernel

On Mon, Jun 30, 2025 at 3:55 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
>
>
> On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> > [xconfig]
> >
> >  - small improvement for choice
> >
> > [gconfig]
> >
> >  - Fix memory leak
> >  - Lots of refactoring
> >  - Migrate GTK 2 to GTK 3
> >  - Fix all compile warnings
> >  - Improve usability (grey out buttons, keep the item selection, etc.)
> >
> >
>
> Hi,
> I have tested all 65 patches here (omitting 52).
> They worked well. Good job.
> I will test your git tree/branch Monday/Tuesday.
>
> I did notice one visual difference. The GTK+2 version of
> gconfig (before the patches) uses an alternating white/light gray
> background for the menu items while the GTK+3 version (after the
> patches) uses an all white background.
>
> I prefer the alternating but it may be just some collateral damage
> in the name of progress.  Or could be something else entirely!


I think
[PATCH 15/66] kconfig: gconf: remove gtk_tree_view_set_rules_hint() calls
affected this.

gtk_tree_view_set_rules_hint() is deprecated.


The comment says "just do it in a theme"
 https://gitlab.gnome.org/GNOME/gtk/-/blob/3.14.0/gtk/gtktreeview.c#L11875

But, I do not know which theme should be applied.




> Before you posted all of these gconfig patches, I was going to ask
> how many gconfig users are there?  I don't see much on the mailing
> list about gconfig from users and suggest that maybe we should just
> drop it, but if you are OK with maintaining it and updating it like
> in this patch series, so be it.
>
> I did seem to have found one gconfig user [1]. Maybe you are also
> a gconfig user.

I keep it as far as I can maintain it.
I am not a heavy user of gconfig, but I maintain all front-ends for now.


>
>
> [1] https://lore.kernel.org/linux-kbuild/67b44d49-d23c-fab0-e165-cc84817562af@infradead.org/
>
>
>
> >
> > Masahiro Yamada (66):
> >   kconfig: set MENU_CHANGED to choice when the selected member is
> >     changed
> >   kconfig: qconf: do not show checkbox icon for choice
> >   kconfig: qconf: show selected choice in the Value column
> >   kconfig: rename menu_get_parent_menu() to
> >     menu_get_menu_or_parent_menu()
> >   kconfig: re-add menu_get_parent_menu() that returns parent menu
> >   kconfig: gconf: make columns resizable
> >   kconfig: gconf: fix potential memory leak in renderer_edited()
> >   kconfig: gconf: always destroy dialog in on_window1_delete_event()
> >   kconfig: gconf: remove old #ifdef GTK_CHECK_VERSION
> >   kconfig: gconf: remove empty if-block
> >   kconfig: gconf: remove meaningless code in init_main_window()
> >   kconfig: gconf: remove unneeded gtk_tree_view_set_headers_visible()
> >     calls
> >   kconfig: gconf: remove gtk_tree_view_column_set_visible() calls
> >   kconfig: gconf: remove gtk_widget_realize() calls
> >   kconfig: gconf: remove gtk_tree_view_set_rules_hint() calls
> >   kconfig: gconf: remove unnecessary gtk_set_locale() call
> >   kconfig: gconf: remove internal-child="image" nodes from glade
> >   kconfig: gconf: remove parents[] array and indent variable
> >   kconfig: gconf: remove unnecessary NULL checks for tree1 and tree2
> >   kconfig: gconf: remove unneeded variable in on_split_clicked()
> >   kconfig: gconf: remove unneeded variables in
> >     on_treeview*_button_press_event()
> >   kconfig: gconf: remove unused 'color' variable
> >   kconfig: gconf: add static qualifiers to variables
> >   kconfig: gconf: move init_*() functions below
> >   kconfig: gconf: refactor view setting code
> >   kconfig: gconf: grey out button for current view
> >   kconfig: gconf: move the main window event handlers below
> >   kconfig: gconf: move button1 initialization below
> >   kconfig: gconf: add static qualifiers to event handlers
> >   kconfig: gconf: remove glade_xml_signal_autoconnect() call
> >   kconfig: gconf: make key_press_event work in left pane too
> >   kconfig: gconf: avoid hardcoding model2 in
> >     on_treeview2_cursor_changed()
> >   kconfig: gconf: avoid hardcoding model2 in renderer_edited()
> >   kconfig: gconf: avoid hardcoding model* in
> >     on_treeview*_button_press_event()
> >   kconfig: gconf: add on_save_clicked() event handler
> >   kconfig: gconf: use GtkFileChooser in on_load1_activate()
> >   kconfig: gconf: use GtkFileChooser in on_save_as1_activate()
> >   kconfig: gconf: use GdkPixbuf in replace_button_icon()
> >   kconfig: gconf: refactor replace_button_icon()
> >   kconfig: gconf: make introduction, about, license dialogs modal
> >   kconfig: gconf: remove global 'tree' variable
> >   kconfig: gconf: merge 'current' and 'browsed' global variables
> >   kconfig: gconf: preserve menu selection when switching view mode
> >   kconfig: gconf: use GtkTreeModelFilter to control row visibility
> >   kconfig: gconf: remove global 'model1' and 'model2' variables
> >   kconfig: gconf: remove init_tree_model()
> >   kconfig: gconf: inline fill_row() into set_node()
> >   kconfig: gconf: do not reconstruct tree store when a symbol is changed
> >   kconfig: gconf: inline display_list() into set_view_mode()
> >   kconfig: gconf: remove dead code in display_tree_part()
> >   kconfig: gconf: rename display_tree_part()
> >   kconfig: gconf: remove fixup_rootmenu()
> >   kconfig: gconf: use size_allocate event handler
> >   kconfig: gconf: replace GDK_space with GDK_KEY_space
> >   kconfig: gconf: replace GTK_STOCK_{OK,NO,CANCEL}
> >   kconfig: gconf: remove "tooltips" property from glade
> >   kconfig: gconf: replace "tooltip" property with "tooltip-text"
> >   kconfig: gconf: remove unnecessary default message in text view
> >   kconfig: gconf: use gtk_check_menu_item_get_active() accessor
> >   kconfig: gconf: use gtk_dialog_get_content_area() accessor
> >   kconfig: gconf: remove GtkHandleBox from glade
> >   kconfig: gconf: rename gconf.glade to gconf.ui
> >   kconfig: gconf: migrate to GTK 3
> >   kconfig: gconf: replace GtkVbox with GtkBox
> >   kconfig: gconf: replace GdkColor with GdkRGBA
> >   kconfig: gconf: show GTK version in About dialog
> >
> >  scripts/kconfig/conf.c                    |    2 +-
> >  scripts/kconfig/gconf-cfg.sh              |   11 +-
> >  scripts/kconfig/gconf.c                   | 1828 ++++++++++-----------
> >  scripts/kconfig/{gconf.glade => gconf.ui} |  360 ++--
> >  scripts/kconfig/lkc.h                     |    1 +
> >  scripts/kconfig/menu.c                    |   20 +
> >  scripts/kconfig/qconf.cc                  |   26 +-
> >  scripts/kconfig/symbol.c                  |    4 +
> >  8 files changed, 1023 insertions(+), 1229 deletions(-)
> >  rename scripts/kconfig/{gconf.glade => gconf.ui} (57%)
> >
>
> --
> ~Randy
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 00/66] kconfig: improve xconfig and gconfig
  2025-06-30 15:48   ` Masahiro Yamada
@ 2025-06-30 23:43     ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-06-30 23:43 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-kbuild, linux-kernel



On 6/30/25 8:48 AM, Masahiro Yamada wrote:
> On Mon, Jun 30, 2025 at 3:55 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>>
>>
>> On 6/24/25 8:04 AM, Masahiro Yamada wrote:
>>> [xconfig]
>>>
>>>  - small improvement for choice
>>>
>>> [gconfig]
>>>
>>>  - Fix memory leak
>>>  - Lots of refactoring
>>>  - Migrate GTK 2 to GTK 3
>>>  - Fix all compile warnings
>>>  - Improve usability (grey out buttons, keep the item selection, etc.)
>>>
>>>
>>
>> Hi,
>> I have tested all 65 patches here (omitting 52).
>> They worked well. Good job.
>> I will test your git tree/branch Monday/Tuesday.
>>
>> I did notice one visual difference. The GTK+2 version of
>> gconfig (before the patches) uses an alternating white/light gray
>> background for the menu items while the GTK+3 version (after the
>> patches) uses an all white background.
>>
>> I prefer the alternating but it may be just some collateral damage
>> in the name of progress.  Or could be something else entirely!
> 
> 
> I think
> [PATCH 15/66] kconfig: gconf: remove gtk_tree_view_set_rules_hint() calls
> affected this.
> 

Yes, that likely did it.

> gtk_tree_view_set_rules_hint() is deprecated.
> 
> 
> The comment says "just do it in a theme"
>  https://gitlab.gnome.org/GNOME/gtk/-/blob/3.14.0/gtk/gtktreeview.c#L11875
> 
> But, I do not know which theme should be applied.

Agreed. I didn't find any help on that subject either.

Thanks.


-- 
~Randy


^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed
  2025-06-30  6:34   ` Randy Dunlap
@ 2025-07-02 13:23     ` Masahiro Yamada
  2025-07-02 22:02       ` Randy Dunlap
  0 siblings, 1 reply; 104+ messages in thread
From: Masahiro Yamada @ 2025-07-02 13:23 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kbuild, linux-kernel

On Mon, Jun 30, 2025 at 3:34 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
>
>
> On 6/24/25 8:04 AM, Masahiro Yamada wrote:
> > In gconf, choice entries display the selected symbol in the 'Value'
> > column, but it is not updated when the selected symbol is changed.
> >
> > Set the MENU_CHANGED flag, so it is updated.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>
> Probably not related to this change (AFAICT), but I was trying to
> reproduce this problem and I cannot do it.

You can try this simple test code.

choice
        prompt "choose"

config A
        bool "A"

config B
        bool "B"

endchoice

In Full mode, open the tree and double-clock the two
radio buttons alternatively. (select A or B back-and-forth)
In the main line code, the Value column of "choose" remains "B".

After this commit, it starts to react to the change, but the fix is not perfect.

In the gconfig-v3 branch, this should work perfectly.




> To enable an option (any options, choice or not), I have to double-click
> on it or (sometimes, not for choice) I can use Y / N / M on the keyboard.
> When I do either of those, the value (including a choice value) is changed.
>
> I mention double-click only because the Help text (Information) says that
> clicking will cycle thru Y/M/N.

Presumably, this should be double-click in gconfig.
(So, the help message should be fixed.)

A single click in the "option" column is used for other functionality.
(open/close the tree item in Split and Full views).



>
> The Information also says that "dot indicates that it is to be compiled as a module".
> I see more of a Dash or Hyphen or just a horizontal bar.

Right. The help message should be fixed.



>
> Thanks for reading...
>
> > ---
> >
> >  scripts/kconfig/symbol.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
> > index d57f8cbba291..26ab10c0fd76 100644
> > --- a/scripts/kconfig/symbol.c
> > +++ b/scripts/kconfig/symbol.c
> > @@ -195,6 +195,10 @@ static void sym_set_changed(struct symbol *sym)
> >
> >       list_for_each_entry(menu, &sym->menus, link)
> >               menu->flags |= MENU_CHANGED;
> > +
> > +     menu = sym_get_choice_menu(sym);
> > +     if (menu)
> > +             menu->flags |= MENU_CHANGED;
> >  }
> >
> >  static void sym_set_all_changed(void)
>
> --
> ~Randy
>


--
Best Regards

Masahiro Yamada

^ permalink raw reply	[flat|nested] 104+ messages in thread

* Re: [PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed
  2025-07-02 13:23     ` Masahiro Yamada
@ 2025-07-02 22:02       ` Randy Dunlap
  0 siblings, 0 replies; 104+ messages in thread
From: Randy Dunlap @ 2025-07-02 22:02 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-kbuild, linux-kernel



On 7/2/25 6:23 AM, Masahiro Yamada wrote:
> On Mon, Jun 30, 2025 at 3:34 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>>
>>
>> On 6/24/25 8:04 AM, Masahiro Yamada wrote:
>>> In gconf, choice entries display the selected symbol in the 'Value'
>>> column, but it is not updated when the selected symbol is changed.
>>>
>>> Set the MENU_CHANGED flag, so it is updated.
>>>
>>> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>>
>> Probably not related to this change (AFAICT), but I was trying to
>> reproduce this problem and I cannot do it.
> 
> You can try this simple test code.
> 
> choice
>         prompt "choose"
> 
> config A
>         bool "A"
> 
> config B
>         bool "B"
> 
> endchoice
> 
> In Full mode, open the tree and double-clock the two
> radio buttons alternatively. (select A or B back-and-forth)
> In the main line code, the Value column of "choose" remains "B".
> 
> After this commit, it starts to react to the change, but the fix is not perfect.
> 
> In the gconfig-v3 branch, this should work perfectly.
> 

OK, confirmed in gconfig-v2 branch.

Tested-by: Randy Dunlap <rdunlap@infradead.org>


One other thing:  if I Quit in today's linux-next (probably similar
to mainline), if the .config file has changed, the Warning box
choices (Yes, No, Cancel) have their first letters underlined and
the Cancel block (just the rectangle itself) is bold, more distinct
than the others, so it must be the default if Enter is pressed.

In the gconfig-v2 branch, the Warning block choices are neither
underlined in their first letter (for us keyboard users) nor is
any one of them Bold (default).  It is a much better UX in the
linux-next/mainline than gconfig-v2.

Is this a change from GTK2 to GTK3?  Unintended?  Fixable?

thanks.

-- 
~Randy

^ permalink raw reply	[flat|nested] 104+ messages in thread

end of thread, other threads:[~2025-07-02 22:03 UTC | newest]

Thread overview: 104+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24 15:04 [PATCH 00/66] kconfig: improve xconfig and gconfig Masahiro Yamada
2025-06-24 15:04 ` [PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed Masahiro Yamada
2025-06-30  6:34   ` Randy Dunlap
2025-07-02 13:23     ` Masahiro Yamada
2025-07-02 22:02       ` Randy Dunlap
2025-06-24 15:04 ` [PATCH 02/66] kconfig: qconf: do not show checkbox icon for choice Masahiro Yamada
2025-06-29 20:15   ` Randy Dunlap
2025-06-30  3:36     ` Masahiro Yamada
2025-06-30  0:51   ` Randy Dunlap
2025-06-30  0:54     ` Randy Dunlap
2025-06-24 15:04 ` [PATCH 03/66] kconfig: qconf: show selected choice in the Value column Masahiro Yamada
2025-06-30  0:56   ` Randy Dunlap
2025-06-24 15:04 ` [PATCH 04/66] kconfig: rename menu_get_parent_menu() to menu_get_menu_or_parent_menu() Masahiro Yamada
2025-06-30  0:58   ` Randy Dunlap
2025-06-24 15:04 ` [PATCH 05/66] kconfig: re-add menu_get_parent_menu() that returns parent menu Masahiro Yamada
2025-06-30  0:59   ` Randy Dunlap
2025-06-24 15:04 ` [PATCH 06/66] kconfig: gconf: make columns resizable Masahiro Yamada
2025-06-30  2:18   ` Randy Dunlap
2025-06-24 15:04 ` [PATCH 07/66] kconfig: gconf: fix potential memory leak in renderer_edited() Masahiro Yamada
2025-06-30  2:21   ` Randy Dunlap
2025-06-24 15:04 ` [PATCH 08/66] kconfig: gconf: always destroy dialog in on_window1_delete_event() Masahiro Yamada
2025-06-30  2:23   ` Randy Dunlap
2025-06-24 15:04 ` [PATCH 09/66] kconfig: gconf: remove old #ifdef GTK_CHECK_VERSION Masahiro Yamada
2025-06-24 15:04 ` [PATCH 10/66] kconfig: gconf: remove empty if-block Masahiro Yamada
2025-06-30  2:25   ` Randy Dunlap
2025-06-24 15:04 ` [PATCH 11/66] kconfig: gconf: remove meaningless code in init_main_window() Masahiro Yamada
2025-06-30  2:25   ` Randy Dunlap
2025-06-24 15:05 ` [PATCH 12/66] kconfig: gconf: remove unneeded gtk_tree_view_set_headers_visible() calls Masahiro Yamada
2025-06-24 15:05 ` [PATCH 13/66] kconfig: gconf: remove gtk_tree_view_column_set_visible() calls Masahiro Yamada
2025-06-24 15:05 ` [PATCH 14/66] kconfig: gconf: remove gtk_widget_realize() calls Masahiro Yamada
2025-06-24 15:05 ` [PATCH 15/66] kconfig: gconf: remove gtk_tree_view_set_rules_hint() calls Masahiro Yamada
2025-06-24 15:05 ` [PATCH 16/66] kconfig: gconf: remove unnecessary gtk_set_locale() call Masahiro Yamada
2025-06-24 15:05 ` [PATCH 17/66] kconfig: gconf: remove internal-child="image" nodes from glade Masahiro Yamada
2025-06-24 15:05 ` [PATCH 18/66] kconfig: gconf: remove parents[] array and indent variable Masahiro Yamada
2025-06-24 15:05 ` [PATCH 19/66] kconfig: gconf: remove unnecessary NULL checks for tree1 and tree2 Masahiro Yamada
2025-06-24 15:05 ` [PATCH 20/66] kconfig: gconf: remove unneeded variable in on_split_clicked() Masahiro Yamada
2025-06-24 15:05 ` [PATCH 21/66] kconfig: gconf: remove unneeded variables in on_treeview*_button_press_event() Masahiro Yamada
2025-06-30  2:40   ` Randy Dunlap
2025-06-30  4:22     ` Masahiro Yamada
2025-06-24 15:05 ` [PATCH 22/66] kconfig: gconf: remove unused 'color' variable Masahiro Yamada
2025-06-24 15:05 ` [PATCH 23/66] kconfig: gconf: add static qualifiers to variables Masahiro Yamada
2025-06-24 15:05 ` [PATCH 24/66] kconfig: gconf: move init_*() functions below Masahiro Yamada
2025-06-24 15:05 ` [PATCH 25/66] kconfig: gconf: refactor view setting code Masahiro Yamada
2025-06-30  2:51   ` Randy Dunlap
2025-06-24 15:05 ` [PATCH 26/66] kconfig: gconf: grey out button for current view Masahiro Yamada
2025-06-30  2:53   ` Randy Dunlap
2025-06-24 15:05 ` [PATCH 27/66] kconfig: gconf: move the main window event handlers below Masahiro Yamada
2025-06-24 15:05 ` [PATCH 28/66] kconfig: gconf: move button1 initialization below Masahiro Yamada
2025-06-24 15:05 ` [PATCH 29/66] kconfig: gconf: add static qualifiers to event handlers Masahiro Yamada
2025-06-30  2:55   ` Randy Dunlap
2025-06-24 15:05 ` [PATCH 30/66] kconfig: gconf: remove glade_xml_signal_autoconnect() call Masahiro Yamada
2025-06-30  2:58   ` Randy Dunlap
2025-06-30  4:14     ` Masahiro Yamada
2025-06-24 15:05 ` [PATCH 31/66] kconfig: gconf: make key_press_event work in left pane too Masahiro Yamada
2025-06-24 15:05 ` [PATCH 32/66] kconfig: gconf: avoid hardcoding model2 in on_treeview2_cursor_changed() Masahiro Yamada
2025-06-24 15:05 ` [PATCH 33/66] kconfig: gconf: avoid hardcoding model2 in renderer_edited() Masahiro Yamada
2025-06-24 15:05 ` [PATCH 34/66] kconfig: gconf: avoid hardcoding model* in on_treeview*_button_press_event() Masahiro Yamada
2025-06-24 15:05 ` [PATCH 35/66] kconfig: gconf: add on_save_clicked() event handler Masahiro Yamada
2025-06-24 15:05 ` [PATCH 36/66] kconfig: gconf: use GtkFileChooser in on_load1_activate() Masahiro Yamada
2025-06-30  3:14   ` Randy Dunlap
2025-06-24 15:05 ` [PATCH 37/66] kconfig: gconf: use GtkFileChooser in on_save_as1_activate() Masahiro Yamada
2025-06-30  3:20   ` Randy Dunlap
2025-06-24 15:05 ` [PATCH 38/66] kconfig: gconf: use GdkPixbuf in replace_button_icon() Masahiro Yamada
2025-06-24 15:05 ` [PATCH 39/66] kconfig: gconf: refactor replace_button_icon() Masahiro Yamada
2025-06-24 15:05 ` [PATCH 40/66] kconfig: gconf: make introduction, about, license dialogs modal Masahiro Yamada
2025-06-30  4:09   ` Randy Dunlap
2025-06-24 15:05 ` [PATCH 41/66] kconfig: gconf: remove global 'tree' variable Masahiro Yamada
2025-06-24 15:05 ` [PATCH 42/66] kconfig: gconf: merge 'current' and 'browsed' global variables Masahiro Yamada
2025-06-24 15:05 ` [PATCH 43/66] kconfig: gconf: preserve menu selection when switching view mode Masahiro Yamada
2025-06-30  5:42   ` Masahiro Yamada
2025-06-24 15:05 ` [PATCH 44/66] kconfig: gconf: use GtkTreeModelFilter to control row visibility Masahiro Yamada
2025-06-24 15:05 ` [PATCH 45/66] kconfig: gconf: remove global 'model1' and 'model2' variables Masahiro Yamada
2025-06-30  4:10   ` Randy Dunlap
2025-06-24 15:05 ` [PATCH 46/66] kconfig: gconf: remove init_tree_model() Masahiro Yamada
2025-06-24 15:05 ` [PATCH 47/66] kconfig: gconf: inline fill_row() into set_node() Masahiro Yamada
2025-06-24 15:05 ` [PATCH 48/66] kconfig: gconf: do not reconstruct tree store when a symbol is changed Masahiro Yamada
2025-06-24 15:05 ` [PATCH 49/66] kconfig: gconf: inline display_list() into set_view_mode() Masahiro Yamada
2025-06-24 15:05 ` [PATCH 50/66] kconfig: gconf: remove dead code in display_tree_part() Masahiro Yamada
2025-06-24 15:05 ` [PATCH 51/66] kconfig: gconf: rename display_tree_part() Masahiro Yamada
2025-06-24 15:05 ` [PATCH 52/66] kconfig: gconf: remove fixup_rootmenu() Masahiro Yamada
2025-06-27 12:46   ` Masahiro Yamada
2025-06-24 15:05 ` [PATCH 53/66] kconfig: gconf: use size_allocate event handler Masahiro Yamada
2025-06-29 17:56   ` Masahiro Yamada
2025-06-30  5:23     ` Randy Dunlap
2025-06-30  5:30       ` Masahiro Yamada
2025-06-24 15:05 ` [PATCH 54/66] kconfig: gconf: replace GDK_space with GDK_KEY_space Masahiro Yamada
2025-06-24 15:05 ` [PATCH 55/66] kconfig: gconf: replace GTK_STOCK_{OK,NO,CANCEL} Masahiro Yamada
2025-06-30  5:26   ` Randy Dunlap
2025-06-24 15:05 ` [PATCH 56/66] kconfig: gconf: remove "tooltips" property from glade Masahiro Yamada
2025-06-24 15:05 ` [PATCH 57/66] kconfig: gconf: replace "tooltip" property with "tooltip-text" Masahiro Yamada
2025-06-30  5:36   ` Randy Dunlap
2025-06-24 15:05 ` [PATCH 58/66] kconfig: gconf: remove unnecessary default message in text view Masahiro Yamada
2025-06-24 15:05 ` [PATCH 59/66] kconfig: gconf: use gtk_check_menu_item_get_active() accessor Masahiro Yamada
2025-06-24 15:05 ` [PATCH 60/66] kconfig: gconf: use gtk_dialog_get_content_area() accessor Masahiro Yamada
2025-06-24 15:05 ` [PATCH 61/66] kconfig: gconf: remove GtkHandleBox from glade Masahiro Yamada
2025-06-24 15:05 ` [PATCH 62/66] kconfig: gconf: rename gconf.glade to gconf.ui Masahiro Yamada
2025-06-24 15:05 ` [PATCH 63/66] kconfig: gconf: migrate to GTK 3 Masahiro Yamada
2025-06-24 15:05 ` [PATCH 64/66] kconfig: gconf: replace GtkVbox with GtkBox Masahiro Yamada
2025-06-24 15:05 ` [PATCH 65/66] kconfig: gconf: replace GdkColor with GdkRGBA Masahiro Yamada
2025-06-24 15:05 ` [PATCH 66/66] kconfig: gconf: show GTK version in About dialog Masahiro Yamada
2025-06-30  6:06   ` Randy Dunlap
2025-06-30  6:55 ` [PATCH 00/66] kconfig: improve xconfig and gconfig Randy Dunlap
2025-06-30 15:48   ` Masahiro Yamada
2025-06-30 23:43     ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).