kconfig: lxdialog: fix cursor render in checklist
authorMatthew Bystrin <dev.mbstr@gmail.com>
Fri, 16 Feb 2024 14:10:14 +0000 (17:10 +0300)
committerMasahiro Yamada <masahiroy@kernel.org>
Tue, 20 Feb 2024 14:06:38 +0000 (23:06 +0900)
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.

Signed-off-by: Matthew Bystrin <dev.mbstr@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/lxdialog/checklist.c

index fd161cfff121fd15e45aebce45bbc38f311d3709..31d0a89fbeb7ac69e2348b902047226cd9551ba0 100644 (file)
@@ -188,9 +188,8 @@ do_resize:
 
        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);