Use main_screen->co instead of current_term->TI_cols as fallback width for never-visible windows

Window management should be getting its idea of screen geometry from screens, rather than
directly from the terminal.
This commit is contained in:
Kevin Easton
2018-05-14 15:25:21 +10:00
parent 5cc052ee6c
commit 9bffcf91ba

View File

@@ -419,11 +419,16 @@ void BX_add_to_invisible_list(Window *window)
invisible_list->prev = window; invisible_list->prev = window;
invisible_list = window; invisible_list = window;
window->prev = NULL; window->prev = NULL;
window->visible = 0; window->visible = 0;
/* Save the width of the screen the window was last on, to use for
* wrapping output while the window is hidden.
*/
if (window->screen) if (window->screen)
window->columns = window->screen->co; window->columns = window->screen->co;
else else
window->columns = current_term->TI_cols; window->columns = main_screen->co;
window->screen = NULL; window->screen = NULL;
} }