diff --git a/VerticalTilingWindowManager.cpp b/VerticalTilingWindowManager.cpp index 7d2425e..1ab77d9 100644 --- a/VerticalTilingWindowManager.cpp +++ b/VerticalTilingWindowManager.cpp @@ -66,10 +66,16 @@ namespace krikkel::NCurses void VerticalTilingWindowManager::updateLayout() { + size_t stackSize = visibleStack.size(); + if(stackSize == 0) + { + rootWindow->clear(); + return; + } + scoped_lock lock(*ncursesMutex); int availableWidth = rootWindow->width(); int availableHeight = rootWindow->height(); - size_t stackSize = visibleStack.size(); int windowHeight = availableHeight / stackSize - 1; if((windowHeight + 1) * stackSize < availableHeight)