@@ -1127,6 +1127,13 @@ void PCSX::GUI::endFrame() {
1127
1127
m_offscreenShaderEditor.configure (this );
1128
1128
m_outputShaderEditor.configure (this );
1129
1129
1130
+ ImGuiID dockspace = ImGui::DockSpaceOverViewport (0 , nullptr , ImGuiDockNodeFlags_PassthruCentralNode);
1131
+ ImGuiContext* context = ImGui::GetCurrentContext ();
1132
+ ImGuiDockNode* dockspaceNode = ImGui::DockContextFindNodeByID (context, dockspace);
1133
+ if (m_fullWindowRender && !dockspaceNode->IsEmpty ()) {
1134
+ m_fullWindowRender = false ;
1135
+ ImGui::SetNextWindowDockID (dockspace);
1136
+ }
1130
1137
if (m_fullWindowRender) {
1131
1138
ImTextureID texture = m_offscreenTextures[m_currentTexture];
1132
1139
const auto basePos = ImGui::GetMainViewport ()->Pos ;
@@ -1152,10 +1159,16 @@ void PCSX::GUI::endFrame() {
1152
1159
} else {
1153
1160
ImGui::SetNextWindowPos (ImVec2 (50 , 50 ), ImGuiCond_FirstUseEver);
1154
1161
ImGui::SetNextWindowSize (ImVec2 (640 , 480 ), ImGuiCond_FirstUseEver);
1155
- bool outputShown = true ;
1162
+ bool outputWindowShown = true ;
1156
1163
if (ImGui::Begin (
1157
- _ (" Output" ), &outputShown ,
1164
+ _ (" Output" ), &outputWindowShown ,
1158
1165
ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoCollapse)) {
1166
+ ImGuiDockNode* outputNode = ImGui::GetWindowDockNode ();
1167
+ if (outputNode && dockspaceNode->OnlyNodeWithWindows == outputNode
1168
+ && (!outputNode->TabBar || outputNode->TabBar ->Tabs .size () == 1 )) {
1169
+ // if output is the only visible window in dockspace, switch to full window render mode automatically
1170
+ outputWindowShown = false ;
1171
+ }
1159
1172
ImVec2 textureSize = ImGui::GetContentRegionAvail ();
1160
1173
if ((m_outputWindowSize.x != textureSize.x ) || (m_outputWindowSize.y != textureSize.y )) {
1161
1174
m_outputWindowSize = textureSize;
@@ -1170,7 +1183,11 @@ void PCSX::GUI::endFrame() {
1170
1183
}
1171
1184
}
1172
1185
ImGui::End ();
1173
- if (!outputShown) m_fullWindowRender = true ;
1186
+ if (!outputWindowShown) {
1187
+ m_fullWindowRender = true ;
1188
+ // full window render mode can't have anything docked in the dockspace
1189
+ ImGui::DockContextClearNodes (context, dockspace, true );
1190
+ }
1174
1191
}
1175
1192
1176
1193
bool showOpenIsoFileDialog = false ;
@@ -1433,6 +1450,8 @@ in Configuration->Emulation, restart PCSX-Redux, then try again.)"));
1433
1450
if (ImGui::BeginMenu (_ (" Rendering" ))) {
1434
1451
if (ImGui::MenuItem (_ (" Full window render" ), nullptr , &m_fullWindowRender)) {
1435
1452
m_setupScreenSize = true ;
1453
+ // full window render mode can't have anything docked in the dockspace
1454
+ ImGui::DockContextClearNodes (context, dockspace, true );
1436
1455
}
1437
1456
if (ImGui::MenuItem (_ (" Fullscreen" ), nullptr , &m_fullscreen)) {
1438
1457
setFullscreen (m_fullscreen);
0 commit comments