[PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed

Masahiro Yamada posted 66 patches 3 months, 2 weeks ago
[PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed
Posted by Masahiro Yamada 3 months, 2 weeks ago
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
Re: [PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed
Posted by Randy Dunlap 3 months, 1 week ago

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
Re: [PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed
Posted by Masahiro Yamada 3 months, 1 week ago
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
Re: [PATCH 01/66] kconfig: set MENU_CHANGED to choice when the selected member is changed
Posted by Randy Dunlap 3 months, 1 week ago

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