Switch to "other" window if closing active window

master
C. McEnroe 2020-02-09 00:39:09 -05:00
parent b30b93f672
commit e0714a9b7e
1 changed files with 5 additions and 1 deletions

6
ui.c
View File

@ -578,7 +578,11 @@ void uiShowNum(size_t num) {
static void windowClose(struct Window *window) {
if (window->id == Network) return;
if (windows.active == window) {
windowShow(window->prev ? window->prev : window->next);
if (windows.other && windows.other != window) {
windowShow(windows.other);
} else {
windowShow(window->prev ? window->prev : window->next);
}
}
if (windows.other == window) windows.other = NULL;
windowRemove(window);