@@ -45,7 +45,8 @@ Explorerplusplus *Explorerplusplus::Create(App *app, const WindowStorageData *st
45
45
Explorerplusplus::Explorerplusplus (App *app, const WindowStorageData *storageData) :
46
46
m_id(idCounter++),
47
47
m_app(app),
48
- m_hContainer(CreateMainWindow(storageData)),
48
+ m_hContainer(CreateMainWindow(storageData,
49
+ app->GetFeatureList ()->IsEnabled(Feature::MultipleWindowsPerSession))),
49
50
m_commandController(this ),
50
51
m_tabBarBackgroundBrush(CreateSolidBrush(TAB_BAR_DARK_MODE_BACKGROUND_COLOR)),
51
52
m_pluginMenuManager(m_hContainer, MENU_PLUGIN_START_ID, MENU_PLUGIN_END_ID),
@@ -98,7 +99,8 @@ Explorerplusplus::~Explorerplusplus()
98
99
*m_destroyed = true ;
99
100
}
100
101
101
- HWND Explorerplusplus::CreateMainWindow (const WindowStorageData *storageData)
102
+ HWND Explorerplusplus::CreateMainWindow (const WindowStorageData *storageData,
103
+ const bool MultipleWindowsPerSession)
102
104
{
103
105
bool isFirstInstance = IsFirstInstance ();
104
106
static bool mainWindowClassRegistered = false ;
@@ -122,8 +124,12 @@ HWND Explorerplusplus::CreateMainWindow(const WindowStorageData *storageData)
122
124
CHECK (res);
123
125
124
126
placement.showCmd = SW_HIDE;
125
- placement.rcNormalPosition =
126
- storageData && isFirstInstance ? storageData->bounds : GetDefaultMainWindowBounds ();
127
+ if (MultipleWindowsPerSession)
128
+ placement.rcNormalPosition =
129
+ storageData ? storageData->bounds : GetDefaultMainWindowBounds ();
130
+ else
131
+ placement.rcNormalPosition =
132
+ storageData && isFirstInstance ? storageData->bounds : GetDefaultMainWindowBounds ();
127
133
SetWindowPlacement (hwnd, &placement);
128
134
129
135
return hwnd;
0 commit comments