attempt to fix the tabs that sometimes get added

This commit is contained in:
fourtf 2019-08-26 11:26:58 +02:00
parent 748920e8fd
commit ea28269951
2 changed files with 8 additions and 4 deletions

View file

@ -219,13 +219,16 @@ Window &WindowManager::getSelectedWindow()
return *this->selectedWindow_; return *this->selectedWindow_;
} }
Window &WindowManager::createWindow(WindowType type) Window &WindowManager::createWindow(WindowType type, bool show)
{ {
assertInGuiThread(); assertInGuiThread();
auto *window = new Window(type); auto *window = new Window(type);
this->windows_.push_back(window); this->windows_.push_back(window);
window->show(); if (show)
{
window->show();
}
if (type != WindowType::Main) if (type != WindowType::Main)
{ {
@ -293,7 +296,7 @@ void WindowManager::initialize(Settings &settings, Paths &paths)
type = WindowType::Popup; type = WindowType::Popup;
} }
Window &window = createWindow(type); Window &window = createWindow(type, false);
if (window_obj.value("state") == "maximized") if (window_obj.value("state") == "maximized")
{ {
@ -399,6 +402,7 @@ void WindowManager::initialize(Settings &settings, Paths &paths)
colNr++; colNr++;
} }
} }
window.show();
} }
if (mainWindow_ == nullptr) if (mainWindow_ == nullptr)

View file

@ -46,7 +46,7 @@ public:
Window &getMainWindow(); Window &getMainWindow();
Window &getSelectedWindow(); Window &getSelectedWindow();
Window &createWindow(WindowType type); Window &createWindow(WindowType type, bool show = true);
int windowCount(); int windowCount();
Window *windowAt(int index); Window *windowAt(int index);