From 210a6a37b4e0dcba634f4d0d1630ffd345932cfd Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 3 Apr 2018 00:55:52 +1000 Subject: [PATCH] DolphinWX: Scale window geometry before passing to backend In macOS, the window size is device-independent points, which may not match the content/backing framebuffer size. --- Source/Core/DolphinWX/FrameTools.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index ddfda40ad5..c5695a95e8 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -614,7 +614,13 @@ void CFrame::OnRenderParentResize(wxSizeEvent& event) m_log_window->Update(); if (g_renderer) - g_renderer->ResizeSurface(width, height); + { + // The window geometry is in device-independent points and may not match the content or + // framebuffer size in macOS. Multiply by the content scaling factor to get the real size. + double scaling_factor = m_render_frame->GetContentScaleFactor(); + g_renderer->ResizeSurface(static_cast(width * scaling_factor), + static_cast(height * scaling_factor)); + } } event.Skip(); }