From ea2826995193032e8f624f8349dd4ccc7ee4e5ac Mon Sep 17 00:00:00 2001 From: fourtf Date: Mon, 26 Aug 2019 11:26:58 +0200 Subject: [PATCH] attempt to fix the tabs that sometimes get added --- src/singletons/WindowManager.cpp | 10 +++++++--- src/singletons/WindowManager.hpp | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/singletons/WindowManager.cpp b/src/singletons/WindowManager.cpp index c91d88440..6861d939d 100644 --- a/src/singletons/WindowManager.cpp +++ b/src/singletons/WindowManager.cpp @@ -219,13 +219,16 @@ Window &WindowManager::getSelectedWindow() return *this->selectedWindow_; } -Window &WindowManager::createWindow(WindowType type) +Window &WindowManager::createWindow(WindowType type, bool show) { assertInGuiThread(); auto *window = new Window(type); this->windows_.push_back(window); - window->show(); + if (show) + { + window->show(); + } if (type != WindowType::Main) { @@ -293,7 +296,7 @@ void WindowManager::initialize(Settings &settings, Paths &paths) type = WindowType::Popup; } - Window &window = createWindow(type); + Window &window = createWindow(type, false); if (window_obj.value("state") == "maximized") { @@ -399,6 +402,7 @@ void WindowManager::initialize(Settings &settings, Paths &paths) colNr++; } } + window.show(); } if (mainWindow_ == nullptr) diff --git a/src/singletons/WindowManager.hpp b/src/singletons/WindowManager.hpp index 038eb41ab..77084eaa0 100644 --- a/src/singletons/WindowManager.hpp +++ b/src/singletons/WindowManager.hpp @@ -46,7 +46,7 @@ public: Window &getMainWindow(); Window &getSelectedWindow(); - Window &createWindow(WindowType type); + Window &createWindow(WindowType type, bool show = true); int windowCount(); Window *windowAt(int index);