+static void mac_enddlg_config(WindowPtr window, int value)
+{
+ Session *s = mac_windowsession(window);
+
+ if (value == 0)
+ mac_closedlg(window);
+ else {
+ s->cfg = s->temp_cfg;
+ mac_startsession(s);
+ mac_closedlg(window);
+ }
+}
+
+static void mac_enddlg_reconfig(WindowPtr window, int value)
+{
+ Session *s = mac_windowsession(window);
+
+ if (value == 0)
+ mac_closedlg(window);
+ else {
+ Config prev_cfg = s->cfg;
+ s->cfg = s->temp_cfg;
+ mac_closedlg(window);
+
+ /* Pass new config data to the logging module */
+ log_reconfig(s->logctx, &s->cfg);
+
+ /*
+ * Flush the line discipline's edit buffer in the
+ * case where local editing has just been disabled.
+ */
+ if (s->ldisc)
+ ldisc_send(s->ldisc, NULL, 0, 0);
+
+ /* 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);
+
+ /* Pass new config data to the back end */
+ if (s->back)
+ s->back->reconfig(s->backhandle, &s->cfg);
+
+ /* Screen size changed ? */
+ if (s->cfg.height != prev_cfg.height ||
+ s->cfg.width != prev_cfg.width ||
+ s->cfg.savelines != prev_cfg.savelines) {
+ request_resize(s, s->cfg.width, s->cfg.height);
+ }
+
+ /* Set the window title */
+ if (s->cfg.wintitle[0])
+ set_title(s, s->cfg.wintitle);
+
+ /* Scroll bar */
+ if (s->cfg.scrollbar != prev_cfg.scrollbar)
+ request_resize(s, s->cfg.width, s->cfg.height);
+
+ /* TODO: zoom, font */
+ }
+}