Skip to contentSkip to conversation

kconfig: lxdialog: fixed cursor render in checklist

PATCH In review Matthew Bystrin 2 participants 2 messages Feb 16, 2024 – Feb 20, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kconfig: lxdialog: fixed cursor render in checklist

When a checklist is opened, the cursor is rendered in a wrong position (after the last list element on the screen). You can observe it by opening any checklist in menuconfig.

Added wmove() to set the cursor in the proper position, just like in menubox.c. Removed wnoutrefresh(dialog) because dialog window has already been updated in print_buttons(). Replaced wnoutrefresh(list) and doupdate() calls with one wrefresh(list) call.

---
 scripts/kconfig/lxdialog/checklist.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
scripts/kconfig/lxdialog/checklist.c +2 -3
index fd161cfff121..31d0a89fbeb7 100644
@@ -188,9 +188,8 @@ int dialog_checklist(const char *title, const char *prompt, int height,
 
 	print_buttons(dialog, height, width, 0);
 
-	wnoutrefresh(dialog);
-	wnoutrefresh(list);
-	doupdate();
+	wmove(list, choice, check_x + 1);
+	wrefresh(list);
 
 	while (key != KEY_ESC) {
 		key = wgetch(dialog);
Signature · 1 line
2.43.0
#1 lore raw
Quoted 11 lines · Matthew Bystrin

When a checklist is opened, the cursor is rendered in a wrong position (after the last list element on the screen). You can observe it by opening any checklist in menuconfig.

Added wmove() to set the cursor in the proper position, just like in menubox.c. Removed wnoutrefresh(dialog) because dialog window has already been updated in print_buttons(). Replaced wnoutrefresh(list) and doupdate() calls with one wrefresh(list) call.

Applied to linux-kbuild.

Thanks.

Quoted 23 lines
---
 scripts/kconfig/lxdialog/checklist.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
scripts/kconfig/lxdialog/checklist.c +2 -4
index fd161cfff121..31d0a89fbeb7 100644
@@ -188,9 +188,8 @@ int dialog_checklist(const char *title, const char *prompt, int height,
 
        print_buttons(dialog, height, width, 0);
 
-       wnoutrefresh(dialog);
-       wnoutrefresh(list);
-       doupdate();
+       wmove(list, choice, check_x + 1);
+       wrefresh(list);
 
        while (key != KEY_ESC) {
                key = wgetch(dialog);
--

2.43.0

Signature · 2 lines
Best Regards
Masahiro Yamada