From 3eb95c84ee594d4a4e5a8c37b01464cff4762c96 Mon Sep 17 00:00:00 2001 From: Dirk Gouders Date: Mon, 6 Aug 2012 16:48:23 +0200 Subject: kconfig/mconf.c: revision of curses initialization. Since commit d0e1e09568 initscr() is called twice in mconf. Do it only in init_dialog() in util.c and there also save the cursor position for the signal handler in mconf.c. Signed-off-by: Dirk Gouders Signed-off-by: Michal Marek --- scripts/kconfig/lxdialog/dialog.h | 1 + scripts/kconfig/lxdialog/util.c | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'scripts/kconfig/lxdialog') diff --git a/scripts/kconfig/lxdialog/dialog.h b/scripts/kconfig/lxdialog/dialog.h index b5211fce0d94..43a58ec09cd4 100644 --- a/scripts/kconfig/lxdialog/dialog.h +++ b/scripts/kconfig/lxdialog/dialog.h @@ -144,6 +144,7 @@ struct dialog_info { */ extern struct dialog_info dlg; extern char dialog_input_result[]; +extern int saved_x, saved_y; /* Needed in signal handler in mconf.c */ /* * Function prototypes diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c index f2375ad7ebc9..109d53117d22 100644 --- a/scripts/kconfig/lxdialog/util.c +++ b/scripts/kconfig/lxdialog/util.c @@ -23,6 +23,9 @@ #include "dialog.h" +/* Needed in signal handler in mconf.c */ +int saved_x, saved_y; + struct dialog_info dlg; static void set_mono_theme(void) @@ -273,6 +276,10 @@ int init_dialog(const char *backtitle) int height, width; initscr(); /* Init curses */ + + /* Get current cursor position for signal handler in mconf.c */ + getyx(stdscr, saved_y, saved_x); + getmaxyx(stdscr, height, width); if (height < 19 || width < 80) { endwin(); -- cgit v1.2.3-59-g8ed1b