If a new session was saved from Change Settings, a side-effect on Windows was
[u/mdw/putty] / mac / macdlg.c
index be0b50d..0a7aeba 100644 (file)
@@ -66,7 +66,6 @@ static void mac_config(int midsession)
 {
     Session *s;
     WinInfo *wi;
-    static struct sesslist sesslist;
     Str255 mactitle;
     char *str;
 
@@ -77,6 +76,7 @@ static void mac_config(int midsession)
         memset(s, 0, sizeof(*s));
         do_defaults(NULL, &s->cfg);
         s->hasfile = FALSE;
+       s->session_closed = FALSE;
     }
 
     /* Copy the configuration somewhere else in case this is a *
@@ -89,9 +89,8 @@ static void mac_config(int midsession)
     else
        s->settings_window = GetNewWindow(wSettings, NULL, (WindowPtr)-1);
 
-    get_sesslist(&sesslist, TRUE);
     s->ctrlbox = ctrl_new_box();
-    setup_config_box(s->ctrlbox, &sesslist, midsession, 0, 0);
+    setup_config_box(s->ctrlbox, midsession, 0, 0);
 
     s->settings_ctrls.data = &s->temp_cfg;
     if (midsession)
@@ -170,6 +169,9 @@ static void mac_enddlg_reconfig(WindowPtr window, int value)
        /* Change the palette */
        palette_reset(s);
 
+       /* Reinitialise line codepage */
+       init_ucs(s);
+
        /* Pass new config data to the terminal */
        term_reconfig(s->term, &s->cfg);
 
@@ -181,7 +183,6 @@ static void mac_enddlg_reconfig(WindowPtr window, int value)
        if (s->cfg.height != prev_cfg.height ||
            s->cfg.width != prev_cfg.width ||
            s->cfg.savelines != prev_cfg.savelines) {
-           term_size(s->term, s->cfg.height, s->cfg.width, s->cfg.savelines);
            request_resize(s, s->cfg.width, s->cfg.height);
        }
 
@@ -189,7 +190,11 @@ static void mac_enddlg_reconfig(WindowPtr window, int value)
        if (s->cfg.wintitle[0])
             set_title(s, s->cfg.wintitle);
 
-       /* TODO: zoom, scroll bar, font */
+       /* Scroll bar */
+       if (s->cfg.scrollbar != prev_cfg.scrollbar)
+           request_resize(s, s->cfg.width, s->cfg.height);
+
+       /* TODO: zoom, font */
     }
 }