fixed crash when all windows were hidden
This commit is contained in:
parent
320f5ba63a
commit
b723aa5f33
|
@ -66,10 +66,16 @@ namespace krikkel::NCurses
|
||||||
|
|
||||||
void VerticalTilingWindowManager::updateLayout()
|
void VerticalTilingWindowManager::updateLayout()
|
||||||
{
|
{
|
||||||
|
size_t stackSize = visibleStack.size();
|
||||||
|
if(stackSize == 0)
|
||||||
|
{
|
||||||
|
rootWindow->clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
scoped_lock lock(*ncursesMutex);
|
scoped_lock lock(*ncursesMutex);
|
||||||
int availableWidth = rootWindow->width();
|
int availableWidth = rootWindow->width();
|
||||||
int availableHeight = rootWindow->height();
|
int availableHeight = rootWindow->height();
|
||||||
size_t stackSize = visibleStack.size();
|
|
||||||
int windowHeight = availableHeight / stackSize - 1;
|
int windowHeight = availableHeight / stackSize - 1;
|
||||||
|
|
||||||
if((windowHeight + 1) * stackSize < availableHeight)
|
if((windowHeight + 1) * stackSize < availableHeight)
|
||||||
|
|
Loading…
Reference in a new issue