Skip to content

Commit

Permalink
dockspaceId
Browse files Browse the repository at this point in the history
  • Loading branch information
malucard committed Feb 28, 2025
1 parent 184cdfd commit 108faf5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/core/arguments.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PCSX::Arguments::Arguments(const CommandLine::args& args) {
auto portablePath = args.get<std::string_view>("portable");
if (portablePath.has_value()) m_portablePath = portablePath.value();
if (std::filesystem::exists("pcsx.json")) m_portable = true;
if (std::filesystem::exists("Makefile")) m_portable = true;
if (std::filesystem::exists(std::filesystem::path("vsprojects") / "pcsx-redux.sln")) m_portable = true;
if (std::filesystem::exists(std::filesystem::path("..") / "pcsx-redux.sln")) m_portable = true;
if (args.get<bool>("safe") || args.get<bool>("testmode") || args.get<bool>("cli")) m_safeModeEnabled = true;
if (args.get<bool>("resetui")) m_uiResetRequested = true;
Expand Down
10 changes: 5 additions & 5 deletions src/gui/gui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1122,12 +1122,12 @@ void PCSX::GUI::endFrame() {
m_offscreenShaderEditor.configure(this);
m_outputShaderEditor.configure(this);

ImGuiID dockspace = ImGui::DockSpaceOverViewport(0, nullptr, ImGuiDockNodeFlags_PassthruCentralNode);
ImGuiID dockspaceId = ImGui::DockSpaceOverViewport(0, nullptr, ImGuiDockNodeFlags_PassthruCentralNode);
ImGuiContext* context = ImGui::GetCurrentContext();
ImGuiDockNode* dockspaceNode = ImGui::DockContextFindNodeByID(context, dockspace);
ImGuiDockNode* dockspaceNode = ImGui::DockContextFindNodeByID(context, dockspaceId);
if (m_fullWindowRender && !dockspaceNode->IsEmpty()) {
m_fullWindowRender = false;
ImGui::SetNextWindowDockID(dockspace);
ImGui::SetNextWindowDockID(dockspaceId);
}
if (m_fullWindowRender) {
ImTextureID texture = m_offscreenTextures[m_currentTexture];
Expand Down Expand Up @@ -1181,7 +1181,7 @@ void PCSX::GUI::endFrame() {
if (!outputWindowShown) {
m_fullWindowRender = true;
// full window render mode can't have anything docked in the dockspace
ImGui::DockContextClearNodes(context, dockspace, true);
ImGui::DockContextClearNodes(context, dockspaceId, true);
}
}

Expand Down Expand Up @@ -1446,7 +1446,7 @@ in Configuration->Emulation, restart PCSX-Redux, then try again.)"));
if (ImGui::MenuItem(_("Full window render"), nullptr, &m_fullWindowRender)) {
m_setupScreenSize = true;
// full window render mode can't have anything docked in the dockspace
ImGui::DockContextClearNodes(context, dockspace, true);
ImGui::DockContextClearNodes(context, dockspaceId, true);

Check warning on line 1449 in src/gui/gui.cc

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Conditional

PCSX::GUI::endFrame increases from 2 complex conditionals with 5 branches to 3 complex conditionals with 8 branches, threshold = 2. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.
}
if (ImGui::MenuItem(_("Fullscreen"), nullptr, &m_fullscreen)) {
setFullscreen(m_fullscreen);
Expand Down

0 comments on commit 108faf5

Please sign in to comment.