diff --git a/Source/Core/DolphinWX/VideoConfigDiag.cpp b/Source/Core/DolphinWX/VideoConfigDiag.cpp index 997fc5a1c5..565827fc22 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/VideoConfigDiag.cpp @@ -175,7 +175,10 @@ static wxArrayString GetListOfResolutions() ZeroMemory(&dmi, sizeof(dmi)); } #elif defined(HAVE_XRANDR) && HAVE_XRANDR - main_frame->m_XRRConfig->AddResolutions(retlist); + std::vector resos; + main_frame->m_XRRConfig->AddResolutions(resos); + for (auto res : resos) + retlist.Add(StrToWxStr(res)); #elif defined(__APPLE__) CFArrayRef modes = CGDisplayCopyAllDisplayModes(CGMainDisplayID(), nullptr); for (CFIndex i = 0; i < CFArrayGetCount(modes); i++) diff --git a/Source/Core/DolphinWX/X11Utils.cpp b/Source/Core/DolphinWX/X11Utils.cpp index 796b0da46f..b1e1ddb0ff 100644 --- a/Source/Core/DolphinWX/X11Utils.cpp +++ b/Source/Core/DolphinWX/X11Utils.cpp @@ -254,8 +254,7 @@ void XRRConfiguration::ToggleDisplayMode(bool bFullscreen) XSync(dpy, false); } -#if defined(HAVE_WX) && HAVE_WX -void XRRConfiguration::AddResolutions(wxArrayString& arrayStringFor_FullscreenResolution) +void XRRConfiguration::AddResolutions(std::vector& resos) { if (!bValid || !screenResources) return; @@ -268,7 +267,6 @@ void XRRConfiguration::AddResolutions(wxArrayString& arrayStringFor_FullscreenRe if (output_info && output_info->crtc && output_info->connection == RR_Connected) { - std::vector resos; for (int j = 0; j < output_info->nmode; j++) for (int k = 0; k < screenResources->nmode; k++) if (output_info->modes[j] == screenResources->modes[k].id) @@ -280,7 +278,6 @@ void XRRConfiguration::AddResolutions(wxArrayString& arrayStringFor_FullscreenRe if (std::find(resos.begin(), resos.end(), strRes) == resos.end()) { resos.push_back(strRes); - arrayStringFor_FullscreenResolution.Add(StrToWxStr(strRes)); } } } @@ -288,7 +285,6 @@ void XRRConfiguration::AddResolutions(wxArrayString& arrayStringFor_FullscreenRe XRRFreeOutputInfo(output_info); } } -#endif #endif diff --git a/Source/Core/DolphinWX/X11Utils.h b/Source/Core/DolphinWX/X11Utils.h index ee5a1ee9ef..d0b5dc0292 100644 --- a/Source/Core/DolphinWX/X11Utils.h +++ b/Source/Core/DolphinWX/X11Utils.h @@ -51,9 +51,7 @@ class XRRConfiguration void Update(); void ToggleDisplayMode(bool bFullscreen); -#if defined(HAVE_WX) && HAVE_WX - void AddResolutions(wxArrayString& arrayStringFor_FullscreenResolution); -#endif + void AddResolutions(std::vector& resos); private: Display *dpy;