Commit 3eb95c84 authored by Dirk Gouders's avatar Dirk Gouders Committed by Michal Marek

kconfig/mconf.c: revision of curses initialization.

Since commit d0e1e095 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: default avatarDirk Gouders <gouders@et.bocholt.fh-gelsenkirchen.de>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent 0d7614f0
...@@ -144,6 +144,7 @@ struct dialog_info { ...@@ -144,6 +144,7 @@ struct dialog_info {
*/ */
extern struct dialog_info dlg; extern struct dialog_info dlg;
extern char dialog_input_result[]; extern char dialog_input_result[];
extern int saved_x, saved_y; /* Needed in signal handler in mconf.c */
/* /*
* Function prototypes * Function prototypes
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
#include "dialog.h" #include "dialog.h"
/* Needed in signal handler in mconf.c */
int saved_x, saved_y;
struct dialog_info dlg; struct dialog_info dlg;
static void set_mono_theme(void) static void set_mono_theme(void)
...@@ -273,6 +276,10 @@ int init_dialog(const char *backtitle) ...@@ -273,6 +276,10 @@ int init_dialog(const char *backtitle)
int height, width; int height, width;
initscr(); /* Init curses */ initscr(); /* Init curses */
/* Get current cursor position for signal handler in mconf.c */
getyx(stdscr, saved_y, saved_x);
getmaxyx(stdscr, height, width); getmaxyx(stdscr, height, width);
if (height < 19 || width < 80) { if (height < 19 || width < 80) {
endwin(); endwin();
......
...@@ -273,7 +273,6 @@ static struct menu *current_menu; ...@@ -273,7 +273,6 @@ static struct menu *current_menu;
static int child_count; static int child_count;
static int single_menu_mode; static int single_menu_mode;
static int show_all_options; static int show_all_options;
static int saved_x, saved_y;
static void conf(struct menu *menu); static void conf(struct menu *menu);
static void conf_choice(struct menu *menu); static void conf_choice(struct menu *menu);
...@@ -862,9 +861,6 @@ int main(int ac, char **av) ...@@ -862,9 +861,6 @@ int main(int ac, char **av)
single_menu_mode = 1; single_menu_mode = 1;
} }
initscr();
getyx(stdscr, saved_y, saved_x);
if (init_dialog(NULL)) { if (init_dialog(NULL)) {
fprintf(stderr, N_("Your display is too small to run Menuconfig!\n")); fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n")); fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment