+extern void winch_called(int signal)
+{
+ world.winch = 1;
+}
+
+
+
+extern void reset_windows()
+{
+ endwin(); /* "[S]tandard way" to recalibrate ncurses post SIGWINCH, says */
+ refresh(); /* <http://invisible-island.net/ncurses/ncurses-intro.html>. */
+ struct Win * w_p = world.wmeta.chain_start;
+ char win_ids[strlen(world.winconf_db.winconf_ids) + 1];
+ memset(win_ids, '\0', strlen(world.winconf_db.winconf_ids) + 1);
+ uint8_t i = 0;
+ char active = '\0';
+ for (; NULL != w_p; w_p = w_p->next, i++)
+ {
+ struct WinConf * wc_p = get_winconf_by_win(w_p);
+ win_ids[i] = wc_p->id;
+ if (w_p == world.wmeta.active)
+ {
+ active = wc_p->id;
+ }
+ }
+ while (0 != world.wmeta.active)
+ {
+ w_p = world.wmeta.active;
+ suspend_win(w_p);
+ free_win(w_p);
+ }
+ delwin(world.wmeta.pad);
+ make_pad();
+ init_wins();
+ if (strlen(win_ids) < 1)
+ {
+ return;
+ }
+ for (i = 0; i < strlen(win_ids); i++)
+ {
+ toggle_window(win_ids[i]);
+ if (active == win_ids[i])
+ {
+ world.wmeta.active = get_win_by_id(win_ids[i]);
+ }
+ }
+}
+
+
+