GL/Context: Better handle resizing with GLX

Fixes fullscreen having no effect when running under XWayland.
This commit is contained in:
Connor McLaughlin 2021-03-27 16:14:33 +10:00
parent 5df28eff9d
commit 47ba6e7449
2 changed files with 14 additions and 14 deletions

View file

@ -105,8 +105,8 @@ 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
if (new_surface_width == 0 && new_surface_height == 0)
{
EGLint surface_width, surface_height;
if (eglQuerySurface(m_display, m_surface, EGL_WIDTH, &surface_width) &&
eglQuerySurface(m_display, m_surface, EGL_HEIGHT, &surface_height))
@ -119,7 +119,7 @@ void ContextEGL::ResizeSurface(u32 new_surface_width /*= 0*/, u32 new_surface_he
{
Log_ErrorPrintf("eglQuerySurface() failed: %d", eglGetError());
}
#endif
}
m_wi.surface_width = new_surface_width;
m_wi.surface_height = new_surface_height;

View file

@ -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();
}