diff --git a/core/rend/gui_cheats.cpp b/core/rend/gui_cheats.cpp index 01d31cbd7..78652b076 100644 --- a/core/rend/gui_cheats.cpp +++ b/core/rend/gui_cheats.cpp @@ -24,7 +24,7 @@ void gui_cheats() { centerNextWindow(); - ImGui::SetNextWindowSize(ImVec2(std::min(screen_width, 600 * scaling), std::min(screen_height, 400 * scaling))); + ImGui::SetNextWindowSize(ImVec2(std::min(ImGui::GetIO().DisplaySize.x, 600 * scaling), std::min(ImGui::GetIO().DisplaySize.y, 400 * scaling))); ImGui::Begin("##main", nullptr, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize); diff --git a/core/rend/gui_util.cpp b/core/rend/gui_util.cpp index 931c7c7c0..697237470 100644 --- a/core/rend/gui_util.cpp +++ b/core/rend/gui_util.cpp @@ -78,7 +78,7 @@ void select_file_popup(const char *prompt, StringCallback callback, } ImGui::SetNextWindowPos(ImVec2(0, 0)); - ImGui::SetNextWindowSize(ImVec2(screen_width, screen_height)); + ImGui::SetNextWindowSize(ImGui::GetIO().DisplaySize); ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0); if (ImGui::BeginPopupModal(prompt, NULL, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize )) diff --git a/core/rend/gui_util.h b/core/rend/gui_util.h index 772be091f..e148c70dc 100644 --- a/core/rend/gui_util.h +++ b/core/rend/gui_util.h @@ -61,5 +61,6 @@ void OptionComboBox(const char *name, config::Option& option, const char *v static inline void centerNextWindow() { - ImGui::SetNextWindowPos(ImVec2(screen_width / 2.f, screen_height / 2.f), ImGuiCond_Always, ImVec2(0.5f, 0.5f)); + ImGui::SetNextWindowPos(ImVec2(ImGui::GetIO().DisplaySize.x / 2.f, ImGui::GetIO().DisplaySize.y / 2.f), + ImGuiCond_Always, ImVec2(0.5f, 0.5f)); }