@@ -43,7 +43,8 @@ Explorerplusplus *Explorerplusplus::Create(App *app, const WindowStorageData *st
4343Explorerplusplus::Explorerplusplus (App *app, const WindowStorageData *storageData) :
4444 m_id(idCounter++),
4545 m_app(app),
46- m_hContainer(CreateMainWindow(storageData)),
46+ m_hContainer(CreateMainWindow(storageData,
47+ app->GetFeatureList ()->IsEnabled(Feature::MultipleWindowsPerSession))),
4748 m_commandController(this ),
4849 m_tabBarBackgroundBrush(CreateSolidBrush(TAB_BAR_DARK_MODE_BACKGROUND_COLOR)),
4950 m_pluginMenuManager(m_hContainer, MENU_PLUGIN_START_ID, MENU_PLUGIN_END_ID),
@@ -95,7 +96,8 @@ Explorerplusplus::~Explorerplusplus()
9596 m_pDirMon->Release ();
9697}
9798
98- HWND Explorerplusplus::CreateMainWindow (const WindowStorageData *storageData)
99+ HWND Explorerplusplus::CreateMainWindow (const WindowStorageData *storageData,
100+ const bool multipleWindowsPerSession)
99101{
100102 bool isFirstInstance = IsFirstInstance ();
101103 static bool mainWindowClassRegistered = false ;
@@ -119,8 +121,12 @@ HWND Explorerplusplus::CreateMainWindow(const WindowStorageData *storageData)
119121 CHECK (res);
120122
121123 placement.showCmd = SW_HIDE;
122- placement.rcNormalPosition =
123- storageData && isFirstInstance ? storageData->bounds : LayoutDefaults::GetDefaultMainWindowBounds ();
124+ if (multipleWindowsPerSession)
125+ placement.rcNormalPosition =
126+ storageData ? storageData->bounds : LayoutDefaults::GetDefaultMainWindowBounds ();
127+ else
128+ placement.rcNormalPosition =
129+ storageData && isFirstInstance ? storageData->bounds : LayoutDefaults::GetDefaultMainWindowBounds ();
124130 SetWindowPlacement (hwnd, &placement);
125131
126132 return hwnd;
0 commit comments