diff --git a/src/common/gl/context_egl.cpp b/src/common/gl/context_egl.cpp index 34da54ba9..b503a32b4 100644 --- a/src/common/gl/context_egl.cpp +++ b/src/common/gl/context_egl.cpp @@ -105,21 +105,21 @@ bool ContextEGL::ChangeSurface(const WindowInfo& new_wi) void ContextEGL::ResizeSurface(u32 new_surface_width /*= 0*/, u32 new_surface_height /*= 0*/) { - // This seems to race on Android... -#ifndef ANDROID - EGLint surface_width, surface_height; - if (eglQuerySurface(m_display, m_surface, EGL_WIDTH, &surface_width) && - eglQuerySurface(m_display, m_surface, EGL_HEIGHT, &surface_height)) + if (new_surface_width == 0 && new_surface_height == 0) { - m_wi.surface_width = static_cast(surface_width); - m_wi.surface_height = static_cast(surface_height); - return; + EGLint surface_width, surface_height; + if (eglQuerySurface(m_display, m_surface, EGL_WIDTH, &surface_width) && + eglQuerySurface(m_display, m_surface, EGL_HEIGHT, &surface_height)) + { + m_wi.surface_width = static_cast(surface_width); + m_wi.surface_height = static_cast(surface_height); + return; + } + else + { + Log_ErrorPrintf("eglQuerySurface() failed: %d", eglGetError()); + } } - else - { - Log_ErrorPrintf("eglQuerySurface() failed: %d", eglGetError()); - } -#endif m_wi.surface_width = new_surface_width; m_wi.surface_height = new_surface_height; diff --git a/src/common/gl/context_glx.cpp b/src/common/gl/context_glx.cpp index 464993a39..454e242d0 100644 --- a/src/common/gl/context_glx.cpp +++ b/src/common/gl/context_glx.cpp @@ -113,7 +113,7 @@ bool ContextGLX::ChangeSurface(const WindowInfo& new_wi) void ContextGLX::ResizeSurface(u32 new_surface_width /*= 0*/, u32 new_surface_height /*= 0*/) { - m_window.Resize(); + m_window.Resize(new_surface_width, new_surface_height); m_wi.surface_width = m_window.GetWidth(); m_wi.surface_height = m_window.GetHeight(); }