]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - gui.c
version.c: Remove bad doxygen \file comment.
[paraslash.git] / gui.c
diff --git a/gui.c b/gui.c
index db291c2583bc38da0634984bf80cb7bab96658c6..b077b00aa9dd08a5c01dbdec06003781013d11cb 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -686,7 +686,7 @@ static void init_wins(int top_lines)
        int bot_lines = LINES - top_lines - 3, sb_lines = 1, in_lines = 1,
                sep_lines = 1;
 
-       assume_default_colors(theme.default_fg, theme.default_bg);
+       assume_default_colors(theme.dflt.fg, theme.dflt.bg);
        if (top.win) {
                wresize(top.win, top_lines, COLS);
                mvwin(top.win, top_y, 0);
@@ -758,16 +758,16 @@ static void init_colors_or_die(void)
                die(EXIT_FAILURE, "fatal: failed to start colors\n");
        FOR_EACH_STATUS_ITEM(i)
                if (theme.data[i].len)
-                       init_pair_or_die(i + 1, theme.data[i].fg,
-                               theme.data[i].bg);
-       init_pair_or_die(COLOR_STATUSBAR, theme.sb_fg, theme.sb_bg);
-       init_pair_or_die(COLOR_COMMAND, theme.cmd_fg, theme.cmd_bg);
-       init_pair_or_die(COLOR_OUTPUT, theme.output_fg, theme.output_bg);
-       init_pair_or_die(COLOR_MSG, theme.msg_fg, theme.msg_bg);
-       init_pair_or_die(COLOR_ERRMSG, theme.err_msg_fg, theme.err_msg_bg);
-       init_pair_or_die(COLOR_SEPARATOR, theme.sep_fg, theme.sep_bg);
-       init_pair_or_die(COLOR_TOP, theme.default_fg, theme.default_bg);
-       init_pair_or_die(COLOR_BOT, theme.default_fg, theme.default_bg);
+                       init_pair_or_die(i + 1, theme.data[i].color.fg,
+                               theme.data[i].color.bg);
+       init_pair_or_die(COLOR_STATUSBAR, theme.sb.fg, theme.sb.bg);
+       init_pair_or_die(COLOR_COMMAND, theme.cmd.fg, theme.cmd.bg);
+       init_pair_or_die(COLOR_OUTPUT, theme.output.fg, theme.output.bg);
+       init_pair_or_die(COLOR_MSG, theme.msg.fg, theme.msg.bg);
+       init_pair_or_die(COLOR_ERRMSG, theme.err_msg.fg, theme.err_msg.bg);
+       init_pair_or_die(COLOR_SEPARATOR, theme.sep.fg, theme.sep.bg);
+       init_pair_or_die(COLOR_TOP, theme.dflt.fg, theme.dflt.bg);
+       init_pair_or_die(COLOR_BOT, theme.dflt.fg, theme.dflt.bg);
 }
 
 /* (Re-)initialize the curses library. */
@@ -873,12 +873,12 @@ static void parse_config_file_or_die(bool override)
        gui_cmdline_parser_config_file(config_file, &conf, &params);
        loglevel = get_loglevel_by_name(conf.loglevel_arg);
        check_key_map_args_or_die();
-       theme_init(conf.theme_arg, &theme);
        err = false;
 out:
        free(config_file);
        if (err)
                exit(EXIT_FAILURE);
+       theme_init(conf.theme_arg, &theme);
 }
 
 /* reread configuration, terminate on errors */
@@ -907,13 +907,6 @@ static int signal_post_select(struct sched *s, __a_unused struct task *t)
        case SIGTERM:
                die(EXIT_FAILURE, "only the good die young (caught SIGTERM)\n");
                return 1;
-       case SIGWINCH:
-               if (curses_active()) {
-                       shutdown_curses();
-                       init_curses();
-                       redraw_bot_win();
-               }
-               return 1;
        case SIGINT:
                PARA_WARNING_LOG("caught SIGINT, reset\n");
                /* Nothing to do. SIGINT killed our child which gets noticed
@@ -1120,13 +1113,19 @@ static int input_post_select(__a_unused struct sched *s, __a_unused struct task
                        in.needs_update = sep.needs_update = false;
        }
        ret = wgetch(top.win);
-       if (ret == ERR || ret == KEY_RESIZE)
+       if (ret == ERR)
                return 0;
-       if (exs == EXEC_IDLE) {
-               handle_command(ret);
+       if (ret == KEY_RESIZE) {
+               if (curses_active()) {
+                       shutdown_curses();
+                       init_curses();
+                       redraw_bot_win();
+               }
                return 0;
        }
-       if (exec_pid != 0)
+       if (exs == EXEC_IDLE)
+               handle_command(ret);
+       else if (exec_pid > 0)
                kill(exec_pid, SIGTERM);
        return 0;
 }
@@ -1446,7 +1445,6 @@ static int setup_tasks_and_schedule(void)
        para_install_sighandler(SIGINT);
        para_install_sighandler(SIGTERM);
        para_install_sighandler(SIGCHLD);
-       para_install_sighandler(SIGWINCH);
        para_install_sighandler(SIGUSR1);
 
        register_task(&sched, &exec_task.task);