X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/b483d9acdf1138f5104aea605d3a6bf06bd95ae4..21a22afe608ae2dbc4a663b7055e7524c54db0c1:/mac/macterm.c?ds=sidebyside diff --git a/mac/macterm.c b/mac/macterm.c index c81e6359..f4b8f4df 100644 --- a/mac/macterm.c +++ b/mac/macterm.c @@ -305,18 +305,6 @@ static pascal OSStatus uni_to_font_fallback(UniChar *ucp, } /* - * Called every time round the event loop. - */ -void mac_pollterm(void) -{ - Session *s; - - for (s = sesslist; s != NULL; s = s->next) { - term_update(s->term); - } -} - -/* * To be called whenever the window size changes. * rows and cols should be desired values. * It's assumed the terminal emulator will be informed, and will set rows @@ -324,14 +312,18 @@ void mac_pollterm(void) */ static void mac_adjustsize(Session *s, int newrows, int newcols) { int winwidth, winheight; + int extraforscroll; - winwidth = newcols * s->font_width + 15; + extraforscroll=s->cfg.scrollbar ? 15 : 0; + winwidth = newcols * s->font_width + extraforscroll; winheight = newrows * s->font_height; SizeWindow(s->window, winwidth, winheight, true); - HideControl(s->scrollbar); - MoveControl(s->scrollbar, winwidth - 15, -1); - SizeControl(s->scrollbar, 16, winheight - 13); - ShowControl(s->scrollbar); + if (s->cfg.scrollbar) { + HideControl(s->scrollbar); + MoveControl(s->scrollbar, winwidth - extraforscroll, -1); + SizeControl(s->scrollbar, extraforscroll + 1, winheight - 13); + ShowControl(s->scrollbar); + } mac_drawgrowicon(s); } @@ -466,6 +458,7 @@ static void mac_adjusttermmenus(WindowPtr window) menu = GetMenuHandle(mFile); DisableItem(menu, iSave); /* XXX enable if modified */ EnableItem(menu, iSaveAs); + EnableItem(menu, iChange); EnableItem(menu, iDuplicate); menu = GetMenuHandle(mEdit); EnableItem(menu, 0); @@ -980,6 +973,8 @@ static void mac_growterm(WindowPtr window, EventRecord *event) newcols = (LoWord(grow_result) - 15) / s->font_width; mac_adjustsize(s, newrows, newcols); term_size(s->term, newrows, newcols, s->cfg.savelines); + s->cfg.height=s->term->rows; + s->cfg.width=s->term->cols; } } @@ -1042,7 +1037,7 @@ static void mac_activateterm(WindowPtr window, EventRecord *event) s = mac_windowsession(window); term_set_focus(s->term, active); term_update(s->term); - if (active) + if (active && s->cfg.scrollbar) ShowControl(s->scrollbar); else { if (HAVE_COLOR_QD())