Switch to "other" window if closing active window
parent
b30b93f672
commit
e0714a9b7e
4
ui.c
4
ui.c
|
@ -578,8 +578,12 @@ void uiShowNum(size_t num) {
|
||||||
static void windowClose(struct Window *window) {
|
static void windowClose(struct Window *window) {
|
||||||
if (window->id == Network) return;
|
if (window->id == Network) return;
|
||||||
if (windows.active == window) {
|
if (windows.active == window) {
|
||||||
|
if (windows.other && windows.other != window) {
|
||||||
|
windowShow(windows.other);
|
||||||
|
} else {
|
||||||
windowShow(window->prev ? window->prev : window->next);
|
windowShow(window->prev ? window->prev : window->next);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (windows.other == window) windows.other = NULL;
|
if (windows.other == window) windows.other = NULL;
|
||||||
windowRemove(window);
|
windowRemove(window);
|
||||||
for (size_t i = 0; i < BufferCap; ++i) {
|
for (size_t i = 0; i < BufferCap; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue